Part Number Hot Search : 
123B3RC B90N6T MBR60 ADUM7234 05111 T2500B 1N629 T1143
Product Description
Full Text Search
 

To Download 68HC05P18A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  order this document by mc68HC05P18A/d non-disclosure agreement required mc68HC05P18A hcmos mic r ocont r oller unit technical data c5h f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required technical data technical data mc68HC05P18A 2 motorola motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola list of sections 3 non-disclosure agreement required technical data mc68HC05P18A list of sections section 1. general description . . . . . . . . . . . . . . . . . . . . 15 section 2. memory map . . . . . . . . . . . . . . . . . . . . . . . . . . 25 section 3. central processor unit (cpu) . . . . . . . . . . . . 33 section 4. interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 section 5. resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 section 6. operating modes . . . . . . . . . . . . . . . . . . . . . . . 49 section 7. input/output (i/o) ports . . . . . . . . . . . . . . . . . 55 section 8. 16-bit timer . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 section 9. serial input/output ports (siop) . . . . . . . . . . 77 section 10. eeprom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 section 11. analog-to-digital (a/d) converter . . . . . . . . 91 section 12. instruction set . . . . . . . . . . . . . . . . . . . . . . . . 97 section 13. electrical specifications . . . . . . . . . . . . . . . 115 section 14. mechanical specifications . . . . . . . . . . . . . 125 section 15. ordering information . . . . . . . . . . . . . . . . . 127 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required list of sections technical data mc68HC05P18A 4 list of sections motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola table of contents 5 non-disclosure agreement required technical data mc68HC05P18A table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.5 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.5.1 power supply (v dd and v ss ) . . . . . . . . . . . . . . . . . . . . . . . .20 1.5.2 oscillator pins (osc1 and osc2) . . . . . . . . . . . . . . . . . . . .20 1.5.2.1 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.5.2.2 ceramic resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.2.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.3 reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.4 port a (pa0?a7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.5 port b (pb5/sdo, pb6/sdi, and pb7/sck) . . . . . . . . . . . .23 1.5.6 port c (pc0?c2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh ) . . . . . . . . . . . . . . . . . . . . . . .23 1.5.7 port d (pd5/ckout and pd7/tcap) . . . . . . . . . . . . . . . . .23 1.5.8 timer output compare (tcmp) . . . . . . . . . . . . . . . . . . . . . .23 1.5.9 maskable interrupt request ( irq) . . . . . . . . . . . . . . . . . . . .24 1.5.10 cpu core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 section 2. memory map 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 2.3 user mode memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 2.4 i/o and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 2.5 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 2.6 rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required table of contents technical data mc68HC05P18A 6 table of contents motorola section 3. central processor unit (cpu) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 3.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.4 arithmetic/logic unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 section 4. interrupts 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.3 cpu interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 4.4 interrupt types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.1 reset interrupt sequence . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.2 software interrupt (swi). . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.3 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.1 external interrupt (irq) . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.2 input capture interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.3 output compare interrupt . . . . . . . . . . . . . . . . . . . . . . . .44 4.4.3.4 timer overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . .44 section 5. resets 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 5.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.4.2 computer operating properly (cop) reset . . . . . . . . . . . . .47 5.4.3 low-voltage reset (lvr). . . . . . . . . . . . . . . . . . . . . . . . . . .48 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC05P18A technical data motorola table of contents 7 non-disclosure agreement required section 6. operating modes 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 6.3 user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 6.4 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 6.4.1 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4.1.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4.1.2 halt mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.4.2 wait instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.5 cop watchdog timer considerations . . . . . . . . . . . . . . . . . . .54 section 7. input/output (i/o) ports 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.7 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 section 8. 16-bit timer 8.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.3 timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 8.4 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.5 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 8.6 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.7 timer status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.8 timer operation during wait mode and halt mode . . . . . . . . .74 8.9 timer operating during stop mode . . . . . . . . . . . . . . . . . . . . .74 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required table of contents technical data mc68HC05P18A 8 table of contents motorola section 9. serial input/output ports (siop) 9.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.3 siop signal format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.1 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.2 serial data input (sdi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.3.3 serial data output (sdo). . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.4 siop registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.4.1 siop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.4.2 siop status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 9.4.3 siop data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 section 10. eeprom 10.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 10.3 eeprom programming register . . . . . . . . . . . . . . . . . . . . . . .86 10.4 programming/erasing procedures . . . . . . . . . . . . . . . . . . . . . .88 section 11. analog-to-digital (a/d) converter 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.3.2 reference supply voltage (v refh ) . . . . . . . . . . . . . . . . . . .92 11.3.3 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.5 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 11.5.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 11.5.2 internal versus external oscillator . . . . . . . . . . . . . . . . . . . .93 11.5.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . . .94 11.6 a/d status and control register. . . . . . . . . . . . . . . . . . . . . . . .94 11.7 a/d conversion value data register . . . . . . . . . . . . . . . . . . . .96 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
table of contents mc68HC05P18A technical data motorola table of contents 9 non-disclosure agreement required 11.8 a/d subsystem operation during wait mode and halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 11.9 a/d subsystem operation during stop mode. . . . . . . . . . . . . .96 section 12. instruction set 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 12.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 12.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 12.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 12.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .102 12.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .103 12.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .104 12.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .106 12.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 12.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 section 13. electrical specifications 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 13.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 13.3 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .116 13.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 13.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 13.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . .118 13.7 active reset characteristics. . . . . . . . . . . . . . . . . . . . . . . . . .119 13.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . .120 13.9 siop timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required table of contents technical data mc68HC05P18A 10 table of contents motorola 13.10 pd5 clock out timing (pd5 clock out option enabled) . . . .122 13.11 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 section 14. mechanical specifications 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 14.3 28-pin plastic dual in-line package (case #710) . . . . . . . . .126 14.4 28-pin small outline package (case #751f) . . . . . . . . . . . . .126 section 15. ordering information 15.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 15.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola list of figures 11 non-disclosure agreement required technical data mc68HC05P18A list of figures figure title page 1-1 mc68HC05P18A block diagram . . . . . . . . . . . . . . . . . . . . . . .17 1-2 user mode pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1-3 oscillator connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 2-1 mc68HC05P18A user mode memory map . . . . . . . . . . . . . . .27 2-2 mc68HC05P18A i/o and control registers memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 2-3 i/o and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 3-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 3-2 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3-3 index register (x). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3-4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3-5 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3-6 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . . .37 4-1 interrupt processing flowchart . . . . . . . . . . . . . . . . . . . . . . . . .41 5-1 reset block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 5-2 cop register (copr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 6-1 stop, halt, and wait modes flowchart . . . . . . . . . . . . . . . . . . .51 7-1 port a i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 7-2 port b i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7-3 port c i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 7-4 port d i/o circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required list of figures technical data mc68HC05P18A 12 list of figures motorola figure title page 8-1 16-bit timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .64 8-2 timer counter registers (tmrh/tmrl) . . . . . . . . . . . . . . . . .66 8-3 alternate counter registers (acrh/acrl) . . . . . . . . . . . . . . .66 8-4 state timing diagram for timer overflow . . . . . . . . . . . . . . . .67 8-5 state timing diagram for timer reset . . . . . . . . . . . . . . . . . . .67 8-6 output compare registers (ocrh/ocrl) . . . . . . . . . . . . . . .68 8-7 output compare software initialization example . . . . . . . . . . .69 8-8 input capture registers (icrh/icrl) . . . . . . . . . . . . . . . . . . .70 8-9 state timing diagram for input capture . . . . . . . . . . . . . . . . . .71 8-10 timer control register (tcr). . . . . . . . . . . . . . . . . . . . . . . . . .72 8-11 timer status register (tsr) . . . . . . . . . . . . . . . . . . . . . . . . . .73 9-1 siop block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9-2 siop timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9-3 siop control register (scr) . . . . . . . . . . . . . . . . . . . . . . . . . .80 9-4 siop status register (ssr). . . . . . . . . . . . . . . . . . . . . . . . . . .82 9-5 siop data register (sdr) . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 10-1 eeprom programming register (eeprog) . . . . . . . . . . . . .86 11-1 a/d status and control register (adscr). . . . . . . . . . . . . . . .94 11-2 a/d conversion value data register (adc) . . . . . . . . . . . . . .96 13-1 siop timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 13-2 pd5 clock out timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 13-3 power-on reset and external reset timing diagram . . . . . .124 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola list of tables 13 non-disclosure agreement required technical data mc68HC05P18A list of tables table title page 4-1 vector address for interrupts and reset . . . . . . . . . . . . . . . . .40 6-1 cop watchdog timer recommendations . . . . . . . . . . . . . . . .54 7-1 port a i/o pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7-2 port b i/o pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7-3 port c i/o pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7-4 port d i/o pin functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 10-1 erase mode select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86 11-1 a/d multiplexer input channel assignments . . . . . . . . . . . . . .95 12-1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . . . . .102 12-2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . . .103 12-3 jump and branch instructions . . . . . . . . . . . . . . . . . . . . . . . .105 12-4 bit manipulation instructions. . . . . . . . . . . . . . . . . . . . . . . . . .106 12-5 control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 12-6 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 12-7 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 15-1 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required list of tables technical data mc68HC05P18A 14 list of tables motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola general description 15 non-disclosure agreement required technical data mc68HC05P18A section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.5 functional pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.5.1 power supply (v dd and v ss ) . . . . . . . . . . . . . . . . . . . . . . . .20 1.5.2 oscillator pins (osc1 and osc2) . . . . . . . . . . . . . . . . . . . .20 1.5.2.1 crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 1.5.2.2 ceramic resonator . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.2.3 external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.3 reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.4 port a (pa0?a7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.5.5 port b (pb5/sdo, pb6/sdi, and pb7/sck) . . . . . . . . . . . .23 1.5.6 port c (pc0?c2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh ) . . . . . . . . . . . . . . . . . . . . . . .23 1.5.7 port d (pd5/ckout and pd7/tcap) . . . . . . . . . . . . . . . . .23 1.5.8 timer output compare (tcmp) . . . . . . . . . . . . . . . . . . . . . .23 1.5.9 maskable interrupt request ( irq) . . . . . . . . . . . . . . . . . . . .24 1.5.10 cpu core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required general description technical data mc68HC05P18A 16 general description motorola 1.2 introduction the motorola mc68HC05P18A is a low-cost microcontroller with: 4-channel, 8-bit analog-to-digital (a/d) converter 16-bit timer with output compare and input capture serial communications port (siop) computer operating properly (cop) watchdog timer the hc05 central processor unit (cpu) core contains: 192 bytes of random-access memory (ram) 8064 bytes of user read-only memory (rom) 128 bytes of electrically erasable programmable read-only memory (eeprom) 21 input/output (i/o) pins (20 bidirectional, 1 input-only) this device is available in: 28-pin plastic dual in-line package (pdip) 28 pin small-outline integrated circuit package (soic) a functional block diagram of the mc68HC05P18A is shown in figure 1-1 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description introduction mc68HC05P18A technical data motorola general description 17 non-disclosure agreement required figure 1-1. mc68HC05P18A block diagram note: a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. ph2 a/ d converter 16-bit timer 1 input capture 1 output compare port d logic cop osc condition code register 1 1 1 i n z c h index register cpu control 0 0 0 stk pntr 1 1 0 0 0 0 0 reset osc1 osc2 pd7/tcap sram ?192 bytes user rom 8064 bytes tcmp irq alu 68hc05 cpu accumulator program counter cpu registers 2 pa7 pa0 pa1 pa2 pa3 pa4 pa5 pa6 data direction register port a pb5/sdo pb6/sdi pb7/sck port b and siop registers and logic v dd v ss pd5/ckout data direction register pc3/ad3 pc4/ad2 pc5/ad1 pc6/ad0 pc7/v refh pc2 port c mux pc1 pc0 eeprom ?128 bytes 4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required general description technical data mc68HC05P18A 18 general description motorola 1.3 features features of the mc68HC05P18A include: low-cost, hc05 core running at 2-mhz bus speed, or the 4-mhz high-speed option 28-pin dip or soic package on-chip crystal/ceramic resonator 8064 bytes of user rom including: 48 bytes of page zero rom 16 bytes of user vectors 192 bytes of on-chip ram 128 bytes of eeprom low-voltage reset (lvr) four-channel, 8-bit a/d converter serial communications port cop watchdog timer with active pull down on reset 16-bit timer with output compare and input capture edge- and level-sensitive interrupt or edge-sensitive only (mask option) 20 bidirectional i/o lines and 1 input-only line individually mask selectable pullups/interrupts on port a pins high current sink and source on two i/o pins, pc0 and pc1 power-saving stop mode and wait mode instructions and stop conversion to halt mode (mask option) mask option for clock output pin f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description mask options mc68HC05P18A technical data motorola general description 19 non-disclosure agreement required 1.4 mask options the mc68HC05P18A has eight mask options: 1. irq is edge- and level-sensitive or edge-sensitive only. 2. siop msb (most-significant bit) first or lsb (least-significant bit) first 3. siop clock rate set to osc divided by 2, 4, 8, 16, 32, 64, 128, or 256 4. cop watchdog timer enabled or disabled 5. stop instruction enabled or converted to halt mode 6. option to enable clock output pin to replace pd5 7. option to individually enable pullups/interrupts on each of the eight port a pins 8. lvr enabled or disabled 1.5 functional pin description this subsection describes the functionality of each pin on the mc68HC05P18A package. note: for pins connected to subsystems described in other sections, a reference to the section is given instead of a detailed functional description. the pinout is shown in figure 1-2 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required general description technical data mc68HC05P18A 20 general description motorola figure 1-2. user mode pinout 1.5.1 power supply (v dd and v ss ) power is supplied to the mcu through v dd and v ss .v dd is connected to a regulated +5-volt supply and v ss is connected to ground. very fast signal transitions occur on the mcu pins. the short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, take special care to provide good power supply bypassing at the mcu. use bypass capacitors with good high-frequency characteristics and position them as close to the mcu as possible. bypassing requirements vary, depending on how heavily the mcu pins are loaded. 1.5.2 oscillator pins (osc1 and osc2) the osc1 and osc2 pins are the control connections for the on-chip oscillator. the osc1 and osc2 pins can accept: 1. a crystal or ceramic resonator, as shown in figure 1-3 (a) 2. an external clock signal, as shown in figure 1-3 (b) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 reset irq pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 sdo/pb5 sdi/pb6 sck/pb7 v ss v dd osc1 osc2 pd7/tcap tcmp pd5/ckout pc0 pc1 pc2 pc3/ad3 pc4/ad2 pc5/ad1 pc6/ad0 pc7/v refh f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description functional pin description mc68HC05P18A technical data motorola general description 21 non-disclosure agreement required the frequency, f osc , of the oscillator or external clock source is divided by two to produce the internal ph2 bus clock operating frequency, f op . the oscillator cannot be turned off by software if the stop-to-halt conversion is enabled via mask option. figure 1-3. oscillator connections 1.5.2.1 crystal the circuit in figure 1-3 (a) shows a typical oscillator circuit for an at-cut, parallel resonant crystal. note: the crystal manufacturer? recommendations should be followed, as the crystal parameters determine the external component values required to provide maximum stability and reliable startup. the load capacitance values used in the oscillator circuit design should include all stray capacitances. mount the crystal and components as close as possible to the pins for startup stabilization and to minimize output distortion. to v dd or stop to v dd or stop (a) crystal or ceramic resonator connections (b) external clock source connections osc1 osc2 mcu 37 pf 37 pf 4.7 m ? mcu osc1 osc2 unconnected external clock f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required general description technical data mc68HC05P18A 22 general description motorola 1.5.2.2 ceramic resonator in cost-sensitive applications, a ceramic resonator can be used in place of the crystal. the circuit in figure 1-3 (a) can be used for a ceramic resonator. note: the crystal manufacturer? recommendations should be followed, as the crystal parameters determine the external component values required to provide maximum stability and reliable startup. the load capacitance values used in the oscillator circuit design should include all stray capacitances. mount the resonator and components as close as possible to the pins for startup stabilization and to minimize output distortion. 1.5.2.3 external clock an external clock from another cmos-compatible device can be connected to the osc1 input, with the osc2 input not connected, as shown in figure 1-3 (b) . 1.5.3 reset ( reset) driving this input low resets the mcu to a known startup state. as an output pin, the reset pin indicates that an internal mcu reset has occurred. the reset pin contains an internal schmitt trigger to improve its noise immunity. refer to section 5. resets . 1.5.4 port a (pa0?a7) port a is comprised of eight i/o pins (pa0?a7). the state of any pin is software programmable and all port a lines are configured as inputs during power-on or reset. eight mask options can be chosen to enable pullups and interrupts (active low) on port a pins (see 1.4 mask options ). refer to section 7. input/output (i/o) ports and section 4. interrupts . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general description functional pin description mc68HC05P18A technical data motorola general description 23 non-disclosure agreement required 1.5.5 port b (pb5/sdo, pb6/sdi, and pb7/sck) port b is comprised of three i/o pins which are shared with the siop communications subsystem. the state of any pin is software programmable and all port b lines are configured as inputs during power-on or reset. refer to section 7. input/output (i/o) ports and section 9. serial input/output ports (siop) . 1.5.6 port c (pc0?c2, pc3/ad3, pc4/ad2, pc5/ad1, pc6/ad0, and pc7/v refh ) port c is comprised of eight i/o pins which are shared with the a/d converter subsystem. the state of any pin is software programmable and all port c lines are configured as inputs during power-on or reset. port pins pc0 and pc1 are capable of sourcing and sinking high currents. refer to section 7. input/output (i/o) ports . 1.5.7 port d (pd5/ckout and pd7/tcap) port d is comprised of two i/o pins and one of them is shared with the 16-bit timer subsystem. the state of pd5/ckout is software programmable and is configured as an input during power-on or reset. pd7 is always an input; it may be read at any time, regardless of the mode of operation the 16-bit timer may be in. refer to section 7. input/output (i/o) ports and section 8. 16-bit timer . note: a mask option turns the pd5/ckout pin into a clock output which is a buffered osc2 signal with a cmos output driver. the clock output or the port d function must be chosen with the mask option and is not alterable in software. 1.5.8 timer output compare (tcmp) tcmp is the output from the 16-bit timer? output compare function. it is low after reset. refer to section 8. 16-bit timer . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required general description technical data mc68HC05P18A 24 general description motorola 1.5.9 maskable interrupt request ( irq) this input pin drives the asynchronous interrupt function of the mcu. the mcu completes the current instruction being executed before it responds to the irq interrupt request. when irq is driven low, the event is latched internally to signify an interrupt has been requested. when the mcu completes its current instruction, the interrupt latch is tested. if the interrupt latch is set, and the interrupt mask bit (i bit) in the condition code register (ccr) is clear, the mcu begins the interrupt sequence. depending on the mask option selected, the irq pin triggers this interrupt on either a negative going edge at the irq pin and/or while the irq pin is held in the low state. in either case, the irq pin must be held low for at least one t ilih time period. if the edge- and level-sensitive mask option is selected, the irq input requires an external resistor connected to v dd for a wired-or operation. if the irq pin is not used, it must be tied to the v dd supply. the irq pin contains an internal schmitt trigger as part of its input circuitry to improve noise immunity. refer to section 4. interrupts . 1.5.10 cpu core the mc68HC05P18A uses a standard m68hc05 series cpu core. a description of the instruction set is in section 12. instruction set . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola memory map 25 non-disclosure agreement required technical data mc68HC05P18A section 2. memory map 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 2.3 user mode memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 2.4 i/o and control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 2.5 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 2.6 rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 2.2 introduction the mc68HC05P18A utilizes 14 address lines to access an internal memory space covering 16 kbytes. this memory space is divided into: input/output (i/o) random-access memory (ram) electrically erasable programmable read-only memory (eeprom) read-only memory (rom) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required memory map technical data mc68HC05P18A 26 memory map motorola 2.3 user mode memory map when the mc68HC05P18A is in user mode, these are active: 32 bytes of i/o 192 bytes of ram 128 bytes of eeprom 8000 bytes of user rom 48 bytes of user page zero rom 16 bytes of user vector rom see figure 2-1 . 2.4 i/o and control registers figure 2-2 and figure 2-3 briefly describe the i/o and control registers at locations $0000?001f. note: reading unimplemented bits returns unknown states, and writing unimplemented bits is ignored. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map i/o and control registers mc68HC05P18A technical data motorola memory map 27 non-disclosure agreement required figure 2-1. mc68HC05P18A user mode memory map 0000 0031 0032 0079 0080 0191 0192 0255 0256 0271 0272 0399 0400 8127 8128 16127 16128 16367 16368 16383 $0000 $001f $0020 $004f $0050 $00bf $00c0 $00ff $0100 $010f $0140 $01bf $01c0 $1fbf $1fc0 $3eff $3f00 $3fef $3ff0 $3fff reset vector (low byte) reset vector (high byte) swi vector (low byte) swi vector (high byte) irq vector (low byte) irq vector (high byte) timer vector (low byte) timer vector (high byte) unimplemented unimplemented $3ff6 $3ff7 $3ff8 $3ff9 $3ffa $3ffb $3ffc $3ffd $3ffe $3fff unimplemented $3ff5 unimplemented $3ff4 unimplemented $3ff3 unimplemented $3ff2 unimplemented $3ff1 cop control register $3ff0 $001f $0000 stack 64 bytes internal ram 192 bytes i/o 32 bytes user vectors rom 16 bytes reserved for test 240 bytes user rom 8000 bytes user rom 48 bytes i/o registers see figure 2-2 eeprom 128 bytes unused 7728 bytes f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required memory map technical data mc68HC05P18A 28 memory map motorola figure 2-2. mc68HC05P18A i/o and control registers memory map port a data register $0000 port b data register $0001 port c data register $0002 port d data register $0003 port a data direction register $0004 port b data direction register $0005 port c data direction register $0006 port d data direction register $0007 unimplemented $0008 unimplemented $0009 siop control register $000a siop status register $000b siop data register $000c unimplemented $000d unimplemented $000e unimplemented $000f unimplemented $0010 unimplemented $0011 timer control register $0012 timer status register $0013 input capture msb $0014 input capture lsb $0015 output compare msb $0016 output compare lsb $0017 timer msb $0018 timer lsb $0019 alternate counter msb $001a alternate counter lsb $001b eeprom programming register $001c a/d converter data register $001d a/d converter control & status register $001e reserved for test $001f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map i/o and control registers mc68HC05P18A technical data motorola memory map 29 non-disclosure agreement required addr. register name bit 7 6 5 4 3 2 1 bit 0 $0000 port a data register (porta) see page 56. read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: unaffected by reset $0001 port b data register (portb) see page 57. read: pb7 pb6 pb5 00000 write: reset: unaffected by reset $0002 port c data register (portc) see page 58. read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: unaffected by reset $0003 port d data register (portd) see page 59. read: pd7 0 pd5 10000 write: reset: unaffected by reset $0004 port a data direction (ddra) see page 56. read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 0 0 0 0 0 0 0 0 $0005 port b data direction (ddrb) see page 57. read: ddrb7 ddrb6 ddrb5 11111 write: reset: 0 0 0 0 0 0 0 0 $0006 port c data direction (ddrc) see page 58. read: ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 0 0 0 0 0 0 0 0 $0007 port d data direction (ddrd) see page 59. read: 0 0 ddrd5 00000 write: reset: 0 0 0 0 0 0 0 0 $0008 unimplemented = unimplemented r = reserved u = unaffected figure 2-3. i/o and control registers (sheet 1 of 4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required memory map technical data mc68HC05P18A 30 memory map motorola $0009 unimplemented $000a siop control register (scr) see page 80. read: 0 spe 0 mstr 0000 write: reset: 0 0 0 0 0 0 0 0 $000b siop status register (ssr) see page 82. read: spif dcol 0 0 0 0 0 0 write: reset: 0 0 0 0 0 0 0 0 $000c siop data register (sdr) see page 83. read: sdr7 sdr6 sdr5 sdr4 sdr3 sdr2 sdr1 sdr0 write: reset: unaffected by reset $000d reserved r r r r r r r r $000e unimplemented $0011 unimplemented $0012 timer control register (tcr) see page 72. read: icie ocie toie 000 iedg olvl write: reset: 0 0 0 0 0 0 u 0 $0013 timer status register (tsr) see page 73. read: icf ocf tof 0 0 0 0 0 write: reset: u u u 0 0 0 0 0 $0014 input capture register (icrh) see page 70. read: icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 write: reset: unaffected by reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. i/o and control registers (sheet 2 of 4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory map i/o and control registers mc68HC05P18A technical data motorola memory map 31 non-disclosure agreement required $0015 input capture register (icrl) see page 70. read: icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 write: reset: unaffected by reset $0016 output compare register (ocrh) see page 68. read: ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 write: reset: unaffected by reset $0017 output compare register (ocrl) see page 68. read: ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 write: reset: unaffected by reset $0018 timer counter register (tmrh) see page 66. read: tmrh7 tmrh6 tmrh5 tmrh4 tmrh3 tmrh2 tmrh1 tmrh0 write: reset: 1 1 1 1 1 1 1 1 $0019 timer counter register (tmrl) see page 66. read: tmrl7 tmrl6 tmrl5 tmrl4 tmrl3 tmrl2 tmrl1 tmrl0 write: reset: 1 1 1 1 1 1 1 1 $001a alternate counter register (acrh) see page 66. read: acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 write: reset: 1 1 1 1 1 1 1 1 $001b alternate counter register (acrl) see page 66. read: acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 write: reset: 1 1 1 1 1 1 1 1 $001c eeprom programming register (eeprog) see page 86. read: 0 cpen 0 er1 er0 latch eerc eepgm write: reset: 0 0 0 0 0 0 0 0 $001d a/d conversion value data register (adc) see page 96. read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: unaffected by reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. i/o and control registers (sheet 3 of 4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required memory map technical data mc68HC05P18A 32 memory map motorola 2.5 ram the user ram consists of 192 bytes (including the stack) at locations $0050?010f. the stack begins at address $00ff. the stack pointer can access 64 bytes of ram from $00ff to $00c0. note: using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 2.6 rom there are 8064 bytes of user rom available, consisting of: 8000 bytes at locations $1fc0?3eff 48 bytes in page zero locations $0020?004f 16 additional bytes for user vectors at locations $3ff0?3fff note: address space $3f00?3fef is reserved for test code. unlike other m68hc05 devices, the mc68HC05P18A does not contain self-check code. $001e a/d converter status and control register (adscr) see page 94. read: cc r adon 00 ch2 ch1 ch0 write: reset: 0 0 0 0 0 0 0 0 $001f reserved r r r r r r r r addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. i/o and control registers (sheet 4 of 4) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola central processor unit (cpu) 33 non-disclosure agreement required technical data mc68HC05P18A section 3. central processor unit (cpu) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 3.3.1 accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.2 index register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.3 stack pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35 3.3.4 program counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.3.5 condition code register . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.4 arithmetic/logic unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 3.2 introduction this section describes the central processor unit (cpu) registers. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required central processor unit (cpu) technical data mc68HC05P18A 34 central processor unit (cpu) motorola 3.3 cpu registers figure 3-1 shows the five cpu registers. cpu registers are not part of the memory map. figure 3-1. programming model accumulator (a) a index register (x) x sp 11 00 00 0 00 0 pcl pch 0 0 zc in 1h 11 0 4 75 condition code register (ccr) program counter (pc) stack pointer (sp) 0 7 8 15 15 5 7 0 0 half-carry flag interrupt mask negative flag zero flag carry/borrow flag 10 6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers mc68HC05P18A technical data motorola central processor unit (cpu) 35 non-disclosure agreement required 3.3.1 accumulator the accumulator (a) is a general-purpose 8-bit register. the cpu uses the accumulator to hold operands and results of arithmetic and non- arithmetic operations. 3.3.2 index register in the indexed addressing modes, the cpu uses the byte in the index register (x) to determine the conditional address of the operand. the 8-bit index register can also serve as a temporary data storage location. 3.3.3 stack pointer the stack pointer (sp) is a 16-bit register that contains the address of the next location on the stack. during a reset or after the reset stack pointer (rsp) instruction, the stack pointer is preset to $00ff. the address in the stack pointer decrements as data is pushed onto the stack and increments as data is pulled from the stack. bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 3-2. accumulator (a) bit 7 654321 bit 0 read: write: reset: unaffected by reset figure 3-3. index register (x) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required central processor unit (cpu) technical data mc68HC05P18A 36 central processor unit (cpu) motorola the 10 most significant bits of the stack pointer are permanently fixed at 000000011, so the stack pointer produces addresses from $00c0 to $00ff. if subroutines and interrupts use more than 64 stack locations, the stack pointer wraps around to address $00ff and begins writing over the previously stored data. a subroutine uses two stack locations. an interrupt uses five locations. 3.3.4 program counter the program counter (pc) is a 16-bit register that contains the address of the next instruction or operand to be fetched. the two most significant bits of the program counter are ignored internally and appear as 00. normally, the address in the program counter automatically increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 bit 0 read: write: reset: 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 figure 3-4. stack pointer (sp) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 bit 0 read: 00 5 write: reset: 0 0 loaded with vectors from $3ff3 and $3fff figure 3-5. program counter (pc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
central processor unit (cpu) cpu registers mc68HC05P18A technical data motorola central processor unit (cpu) 37 non-disclosure agreement required 3.3.5 condition code register the condition code register (ccr) is an 8-bit register whose three most significant bits are permanently fixed at 111. the condition code register contains the interrupt mask and four flags that indicate the results of the instruction just executed. the following paragraphs describe the functions of the condition code register. half-carry flag the cpu sets the half-carry flag when a carry occurs between bits 3 and 4 of the accumulator during an add or adc operation. the half- carry flag is required for binary coded decimal (bcd) arithmetic operations. interrupt mask setting the interrupt mask disables interrupts. if an interrupt request occurs while the interrupt mask is logic 0, the cpu saves the cpu registers on the stack, sets the interrupt mask, and then fetches the interrupt vector. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the cpu processes the latched interrupt as soon as the interrupt mask is cleared again. a return-from-interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its cleared state. after any reset, the interrupt mask is set and can be cleared only by a software instruction. negative flag the cpu sets the negative flag when an arithmetic operation, logical operation, or data manipulation produces a negative result. bit 7 654321 bit 0 read: 1 1 1 hinzc write: reset: 1 1 1u1uuu = unimplemented u = unaffected figure 3-6. condition code register (ccr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required central processor unit (cpu) technical data mc68HC05P18A 38 central processor unit (cpu) motorola zero flag the cpu sets the zero flag when an arithmetic operation, logical operation, or data manipulation produces a result of $00. carry/borrow flag the cpu sets the carry/borrow flag when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. some logical operations and data manipulation instructions also clear or set the carry/borrow flag. 3.4 arithmetic/logic unit the arithmetic/logic unit (alu) performs the arithmetic and logical operations defined by the instruction set. the binary arithmetic circuits decode instructions and set up the alu for the selected operation. most binary arithmetic is based on the addition algorithm, carrying out subtraction as negative addition. multiplication is not performed as a discrete operation but as a chain of addition and shift operations within the alu. the multiply instruction (mul) requires 11 internal clock cycles to complete this chain of operations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola interrupts 39 non-disclosure agreement required technical data mc68HC05P18A section 4. interrupts 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 4.3 cpu interrupt processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40 4.4 interrupt types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.1 reset interrupt sequence . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.2 software interrupt (swi). . . . . . . . . . . . . . . . . . . . . . . . . . . .42 4.4.3 hardware interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.1 external interrupt ( irq) . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.2 input capture interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . .43 4.4.3.3 output compare interrupt . . . . . . . . . . . . . . . . . . . . . . . .44 4.4.3.4 timer overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . .44 4.2 introduction the mcu can be interrupted six different ways: 1. non-maskable software interrupt instruction (swi) 2. external asynchronous interrupt ( irq) 3. input capture interrupt (timer) 4. output compare interrupt (timer) 5. timer overflow interrupt (timer) 6. port a interrupt, if selected as a mask option f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required interrupts technical data mc68HC05P18A 40 interrupts motorola 4.3 cpu interrupt processing interrupts cause the processor to save the register contents on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is completed. when the current instruction is completed, the processor checks all pending hardware interrupts. if interrupts are not masked (i bit in the condition code register is clear), and the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing. otherwise, the next instruction is fetched and executed. the swi is executed the same as any other instruction, regardless of the i-bit state. when an interrupt is to be processed, the cpu puts the register contents on the stack, sets the i bit in the ccr, and fetches the address of the corresponding interrupt service routine from the vector table at locations $3ff0?3fff. if more than one interrupt is pending when the interrupt vector is fetched, the interrupt with the highest vector location, shown in table 4-1 , is serviced first. a return-from-interrupt (rti) instruction is used to signify when the interrupt software service routine is completed. the rti instruction table 4-1. vector address for interrupts and reset register flag name interrupts cpu interrupt vector address n/a n/a reset reset $3ffe?3fff n/a n/a software swi $3ffc?3ffd n/a n/a external interrupt irq $3ffa?3ffb tsr icf timer input capture timer $3ff8?3ff9 tsr ocf timer output compare timer $3ff8?3ff9 tsr tof timer over?w timer $3ff8?3ff9 n/a n/a unimplemented n/a $3ff6?3ff7 n/a n/a unimplemented n/a $3ff4?3ff5 n/a n/a unimplemented n/a $3ff2?3ff3 n/a n/a unimplemented n/a $3ff0?3ff1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
interrupts cpu interrupt processing mc68HC05P18A technical data motorola interrupts 41 non-disclosure agreement required causes the cpu state to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. figure 4-1 shows the sequence of events that occur during interrupt processing. figure 4-1. interrupt processing flowchart is i bit set? from reset load pc from swi: $3ffc and $3ffd irq: $3ffa?3ffb timer: $3ff8?3ff9 set i bit in ccr stack pc, x, a, cc clear irq request latch restore registers from stack cc, a, x, pc y n execute instruction fetch next instruction irq interrupt? y n timer interrupt? y n swi instruction? y n rti instruction? y n f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required interrupts technical data mc68HC05P18A 42 interrupts motorola 4.4 interrupt types the interrupts fall into these three categories which are discussed here: reset interrupt sequence software interrupt (swi) hardware interrupts 4.4.1 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner as shown in figure 4-1 . a low-level input on the reset pin or internally generated rst signal causes: the program to vector to its starting address, which is specified by the contents of memory locations $3ffe and $3fff the i bit in the condition code register (ccr) to be set the mcu to be configured to a known state as described in section 5. resets . 4.4.2 software interrupt (swi) the swi is an executable instruction. it is also a non-maskable interrupt since it is executed regardless of the state of the i bit in the ccr. as with any instruction, interrupts pending during the previous instruction are serviced before the swi opcode is fetched. the interrupt service routine address for the swi instruction is specified by the contents of memory locations $3ffc and $3ffd. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
interrupts interrupt types mc68HC05P18A technical data motorola interrupts 43 non-disclosure agreement required 4.4.3 hardware interrupts all hardware interrupts are maskable by the i bit in the ccr. if the i bit is set, all hardware interrupts (internal and external) are disabled. clearing the i bit enables the hardware interrupts. the four hardware interrupts are explained here: external interrupt ( irq) input capture interrupt output compare interrupt timer overflow interrupt 4.4.3.1 external interrupt ( irq) the irq pin drives an asynchronous interrupt to the cpu. an edge detector flip-flop is latched on the falling edge of irq. if either the output from the internal edge detector flip-flop or the level on the irq pin is low, a request is synchronized to the cpu to generate the irq interrupt. if the edge-sensitive only mask option is selected, the output of the internal edge detector flip-flop is sampled and the input level on the irq pin is ignored. if port a interrupts are selected as a mask option, a port a interrupt uses the same vector. the interrupt service routine address is specified by the contents of memory locations $3ffa and $3ffb. note: the internal interrupt latch is cleared 9 ph2 clock cycles after the interrupt is recognized (after location $3ffa is read). therefore, another external interrupt pulse could be latched during the irq service routine. when the edge- and level-sensitive mask option is selected, the voltage applied to the irq pin must return to the high state before the return- from-interrupt (rti) instruction in the interrupt service routine is executed. 4.4.3.2 input capture interrupt the input capture interrupt is generated by the 16-bit timer as described in section 8. 16-bit timer . the input capture interrupt flag is located in f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required interrupts technical data mc68HC05P18A 44 interrupts motorola the timer status register (tsr) and its corresponding enable bit can be found in the timer control register (tcr). the i bit in the ccr must be clear in order for the input capture interrupt to be enabled. the interrupt service routine address is specified by the contents of memory locations $3ff8 and $3ff9. 4.4.3.3 output compare interrupt the output compare interrupt is generated by the 16-bit timer as described in section 8. 16-bit timer . the output compare interrupt flag is located in register tsr and its corresponding enable bit can be found in register tcr. the i bit in the ccr must be clear in order for the output compare interrupt to be enabled. the interrupt service routine address is specified by the contents of memory locations $3ff8 and $3ff9. 4.4.3.4 timer overflow interrupt the timer overflow interrupt is generated by the 16-bit timer as described in section 8. 16-bit timer . the timer overflow interrupt flag is located in register tsr and its corresponding enable bit can be found in register tcr. the i bit in the ccr must be clear in order for the timer overflow interrupt to be enabled. this internal interrupt will vector to the interrupt service routine located at the address specified by the contents of memory locations $3ff8 and $3ff9. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola resets 45 non-disclosure agreement required technical data mc68HC05P18A section 5. resets 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5.3 external reset ( reset). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 5.4 internal resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46 5.4.1 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.4.2 computer operating properly (cop) reset . . . . . . . . . . . . .47 5.4.3 low-voltage reset (lvr). . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.2 introduction the mcu can be reset from four sources: one external input three internal reset conditions the reset pin is an input with a schmitt trigger as shown in figure 5-1 . the cpu and all peripheral modules are reset by the internal reset signal (rst), which is the logical or of internal reset functions and is clocked by ph2. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required resets technical data mc68HC05P18A 46 resets motorola figure 5-1. reset block diagram 5.3 external reset ( reset) the reset input is the only external reset and is connected to an internal schmitt trigger. the external reset occurs whenever the reset input is driven below the lower threshold and remains in reset until the reset pin rises above the upper threshold. the upper and lower thresholds are given in section 13. electrical specifications . 5.4 internal resets the three internally generated resets are: initial power-on reset (por) computer operating properly (cop) watchdog timer low-voltage reset (lvr) cpu latch reset cop watchdog (copr) rst osc data address ph2 to other peripherals s low-voltage reset (lvr) v dd to irq logic power-on reset (por) v dd ph2 clocked one-shot pulse width = 4 x e-clk d irq f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resets internal resets mc68HC05P18A technical data motorola resets 47 non-disclosure agreement required 5.4.1 power-on reset (por) the internal por is generated at power-up to allow the clock oscillator to stabilize. the por is strictly for power turn-on conditions and should not be used to detect a drop in the power supply voltage. there is a 4064 ph2 clock cycle oscillator stabilization delay after the oscillator becomes active. the por generates the rst signal and resets the mcu. at the same time, the por pulls the reset pin low allowing external devices to be reset with the mcu. if any other reset function is active at the end of this 4064 ph2 clock cycle delay, the rst signal remains active until the other reset condition(s) end. 5.4.2 computer operating properly (cop) reset when the cop watchdog timer is enabled by mask option, the internal cop reset is generated automatically by a timeout of the cop watchdog timer. this timer is implemented with an 18-stage ripple counter that provides a timeout period of 65.5 ms when a 4-mhz oscillator is used. the cop watchdog counter is cleared by writing a logical 0 to bit 0 at location $3ff0. the cop register is shared with the most-significant bit (msb) of an unimplemented user interrupt vector, as shown in figure 5-2 . reading this location returns the msb of the unimplemented user interrupt vector. writing to this location clears the cop watchdog timer. address: $3ff0 bit 7 654321 bit 0 read: 00000000 write: r copr reset: unaffected by reset r = reserved = unimplemented figure 5-2. cop register (copr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required resets technical data mc68HC05P18A 48 resets motorola 5.4.3 low-voltage reset (lvr) the internal lvr reset is generated when the supply voltage to the v dd pin falls below a nominal 3.80 vdc. the lvr threshold is not intended to be an accurate and stable trip point, but is intended to assure that the cpu is held in reset when the v dd supply voltage is below reasonable operating limits. if the lvr is tripped for a short time, the lvr reset signal will last at least two cycles of the cpu bus clock, ph2. a mask option is provided to disable the lvr. the lvr generates the rst signal, which resets the cpu and other peripherals. if any other reset function is active at the end of the lvr reset signal, the rst signal remains in the reset condition until the other reset condition(s) end. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola operating modes 49 non-disclosure agreement required technical data mc68HC05P18A section 6. operating modes 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 6.3 user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 6.4 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 6.4.1 stop instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4.1.1 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52 6.4.1.2 halt mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.4.2 wait instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 6.5 cop watchdog timer considerations . . . . . . . . . . . . . . . . . . .54 6.2 introduction the mc68HC05P18A has one user mode of operation and several low- power modes which are described in this section. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required operating modes technical data mc68HC05P18A 50 operating modes motorola 6.3 user mode the user mode allows the mcu to function as a self-contained microcontroller, with maximum use of the pins for on-chip peripheral functions. all address and data activity occurs within the mcu and is not available externally. user mode is entered on the rising edge of reset if the irq pin is within the normal operating voltage range. in the user mode, there is: an 8-bit input/output (i/o) port a second 8-bit i/o port shared with the analog-to-digital (a/d) subsystem one 3-bit i/o port shared with the serial input/output port (siop) one 2-bit i/o port shared with the 16-bit timer subsystem 6.4 low-power modes the mc68HC05P18A is capable of running in a low-power mode in each of its configurations. the wait and stop instructions provide three modes that reduce the power required for the mcu by stopping various internal clocks and/or the on-chip oscillator. the stop and wait instructions are not normally used if the computer operating properly (cop) watchdog timer is enabled. the stop conversion mask option is used to modify the behavior of the stop instruction from stop mode to halt mode. the flow of the stop, halt, and wait modes is shown in figure 6-1 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes low-power modes mc68HC05P18A technical data motorola operating modes 51 non-disclosure agreement required figure 6-1. stop, halt, and wait modes flowchart 1. fetch reset vector or 2. service interrupt a. stack b. set i bit c. vector to interrupt routine wait stop to halt mask option? y n or external reset ? y n irq external interrupt? y n stop external oscillator stop internal timer clock reset startup delay restart external oscillator start stabilization delay end of stabilization delay? y n irq external interrupt? y n external oscillator active and internal timer clock active restart internal processor clock stop internal processor clock clear i bit in ccr timer internal interrupt? y n or external reset? y n stop halt or external reset? y n irq external interrupt? y n external oscillator active and internal timer clock active timer internal interrupt? y n cop internal reset? y n cop internal reset? y n stop rc oscillator lvr lvr lvr stop internal processor clock clear i bit in ccr stop rc oscillator stop internal processor clock clear i bit in ccr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required operating modes technical data mc68HC05P18A 52 operating modes motorola 6.4.1 stop instruction the stop instruction can result in one of two modes of operation, depending on the mask option. 1. if the stop conversion to halt mask option is not chosen, the stop instruction behaves like a normal stop instruction in the m68hc05 family and places the mcu in stop mode. 2. if the stop conversion to halt mask option is chosen, the stop instruction behaves like a wait instruction (with the exception of a brief delay at startup) and places the mcu in halt mode. 6.4.1.1 stop mode execution of the stop instruction without conversion to halt places the mcu in its lowest power consumption mode. in stop mode, the internal oscillator is turned off, halting all internal processing, including the cop watchdog timer. the rc oscillator that feeds the electrically erasable programmable read-only memory (eeprom) and the a/d converter is also stopped. execution of the stop instruction automatically clears the i bit in the condition code register so that the irq external interrupt is enabled. all other registers and memory remain unaltered. all input/output lines remain unchanged. the mcu can be brought out of the stop mode only by: ?n irq external interrupt port a external interrupt, if selected as a mask option an externally generated reset when exiting stop mode, the internal oscillator resumes after a 4064 ph2 clock cycle oscillator stabilization delay. note: execution of the stop instruction without conversion to halt (via mask option) causes the oscillator to stop, and therefore disable the cop watchdog timer. if the cop watchdog timer is to be used, stop mode should be changed to halt mode by selecting the appropriate mask option. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operating modes low-power modes mc68HC05P18A technical data motorola operating modes 53 non-disclosure agreement required 6.4.1.2 halt mode execution of the stop instruction with the conversion to halt places the mcu in this low-power mode. halt mode consumes the same amount of power as wait mode. note: both halt and wait modes consume more power than stop mode. in halt mode the ph2 clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the 16-bit timer or a reset to be generated from the cop watchdog timer. execution of the stop instruction automatically clears the i bit in the condition code register, enabling the irq external interrupt. all other registers, memory, and input/output lines remain in their previous states. if the 16-bit timer interrupt is enabled, it causes the processor to exit halt mode and resume normal operation. halt mode also can be exited when an irq external interrupt or external reset occurs. when exiting halt mode, the ph2 clock resumes after a delay of one to 4064 ph2 clock cycles. this varied delay time is the result of the halt mode exit circuitry testing the oscillator stabilization delay timer (a feature of stop mode) which has been free-running (a feature of wait mode). note: halt mode is not intended for normal use. this feature is provided to keep the cop watchdog timer active in the event a stop instruction is inadvertently executed. 6.4.2 wait instruction the wait instruction places the mcu in a low-power mode, which consumes more power than stop mode. in wait mode, the ph2 clock is halted, suspending all processor and internal bus activity. internal timer clocks remain active, permitting interrupts to be generated from the 16- bit timer and reset to be generated from the cop watchdog timer. execution of the wait instruction automatically clears the i bit in the condition code register, enabling the irq external interrupt. all other registers, memory, and input/output lines remain in their previous state. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required operating modes technical data mc68HC05P18A 54 operating modes motorola if the 16-bit timer interrupt is enabled, it causes the processor to exit wait mode and resume normal operation. the 16-bit timer may be used to generate a periodic exit from wait mode. wait mode may also be exited when an irq or reset occurs. note: if port a interrupts are selected as a mask option, the processor also will exit wait mode. 6.5 cop watchdog timer considerations the cop watchdog timer is active in the user mode of operation when selected by mask option. executing the stop instruction without conversion to halt via mask option causes the cop to be disabled. therefore, it is recommended that the stop instruction be modified to produce halt mode via mask option if the cop watchdog timer is enabled. furthermore, it is recommended that the cop watchdog timer be disabled for applications that use the halt or wait mode for time periods that exceed the cop timeout period. cop watchdog timer interactions are summarized in table 6-1 . table 6-1. cop watchdog timer recommendations if these conditions exist: then the cop watchdog timer should: stop instruction wait time halt mode selected via mask option wait time less than cop timeout enable or disable cop via mask option halt mode selected via mask option wait time more than cop timeout disable cop via mask option stop mode selected via mask option any length wait time disable cop via mask option f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola input/output (i/o) ports 55 non-disclosure agreement required technical data mc68HC05P18A section 7. input/output (i/o) ports 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.7 i/o port programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 7.2 introduction in user mode, 20 bidirectional input/output (i/o) lines are arranged as: two 8-bit i/o ports, port a and port c one 3-bit i/o port, port b one 1-bit i/o port, port d these ports are programmable as either inputs or outputs under software control of the data direction registers (ddrs). there is also an input-only pin associated with port d. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required input/output (i/o) ports technical data mc68HC05P18A 56 input/output (i/o) ports motorola 7.3 port a port a is an 8-bit bidirectional port which can share its pins with the irq interrupt system, as shown in figure 7-1 . each port a pin is controlled by the corresponding bits in a data direction register and a data register. the port a data register is located at address $0000. the port a data direction register (ddra) is located at address $0004. reset clears the ddra thereby initializing port a as an input port. the port a data register is unaffected by reset. figure 7-1. port a i/o circuitry 100 a pullup read $0000 write $0000 read $0004 data register bit to irq interrupt system i/o pin output mask option (pullup inhibit) internal hc05 data bus reset (rst) write $0004 data direction register bit v dd f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port b mc68HC05P18A technical data motorola input/output (i/o) ports 57 non-disclosure agreement required 7.4 port b port b is a 3-bit bidirectional port that can share pins pb5?b7 with the serial input/output port (siop) communications subsystem. the port b data register is located at address $0001 and its data direction register (ddr) is located at address $0005. reset does not affect the data registers, but clears the ddrs, thereby setting all of the port pins to input mode. writing a 1 to a ddr bit sets the corresponding port pin to output mode (see figure 7-2 ). port b may be used for general i/o applications when the siop subsystem is disabled. the spe bit in register siop control register (spcr) is used to enable/disable the siop subsystem. when the siop subsystem is enabled, port b registers are still accessible to software. writing to either of the port b registers while a data transfer is under way could corrupt the data. see section 9. serial input/output ports (siop) for a discussion of the siop subsystem. figure 7-2. port b i/o circuitry read $0001 write $0001 read $0005 data register bit i/o pin output internal hc05 data bus reset (rst) write $0005 data direction register bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required input/output (i/o) ports technical data mc68HC05P18A 58 input/output (i/o) ports motorola 7.5 port c port c is an 8-bit bidirectional port that can share pins pc3?c7 with the analog-to-digital (a/d) converter subsystem. the port c data register is located at address $0002 and its data direction register (ddr) is located at address $0006. reset does not affect the data registers, but clears the ddrs, thereby setting all of the port pins to input mode. writing a 1 to a ddr bit sets the corresponding port pin to output mode (see figure 7-3 ). two port c pins, pc0 and pc1, can source and sink a higher current than a typical i/o pin. see section 13. electrical specifications regarding current specifications. port c may be used for general i/o applications when the a/d subsystem is disabled. the adon bit in the a/d status and control register (adsc) is used to enable/disable the a/d subsystem. caution: care must be exercised when using pins pc0?c2 while the a/d subsystem is enabled. accidental changes to bits that affect pins pc3?c7 in the data or ddr registers will produce unpredictable results in the a/d subsystem. see section 11. analog-to-digital (a/d) converter . figure 7-3. port c i/o circuitry read $0002 write $0002 read $0006 data register bit i/o pin output internal hc05 data bus reset (rst) write $0006 data direction register bit high current capability, pc0 and pc1 only f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports port d mc68HC05P18A technical data motorola input/output (i/o) ports 59 non-disclosure agreement required 7.6 port d port d is a 2-bit port with: one bidirectional pin, pd5/ckout one input-only pin, pd7 pin pd7 is shared with the 16-bit timer. there is a mask option to have pd5 replaced with the clock output. the port d data register is located at address $0003 and its data direction register (ddr) is located at address $0007. reset does not affect the data registers, but clears the ddrs, thereby setting pd5/ckout to input mode. writing a 1 to ddr bit 5 sets pd5/ckout to output mode (see figure 7-4 ). port d may be used for general i/o applications regardless of the state of the 16-bit timer. since pd7 is an input-only line, its state can be read from the port d data register at any time. figure 7-4. port d i/o circuitry read $0003 write $0003 read $0007 data register bit i/o pin output internal hc05 data bus reset (rst) write $0007 data direction register bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required input/output (i/o) ports technical data mc68HC05P18A 60 input/output (i/o) ports motorola 7.7 i/o port programming each pin on ports a through port d, with the exception of pin 7 of port d, may be programmed as an input or an output under software control as shown in table 7-1 , table 7-2 , table 7-3 , and table 7-4 . the direction of a pin is determined by the state of its corresponding bit in the associated port data direction register (ddr). a pin is configured as an output if its corresponding ddr bit is set to a logic 1. a pin is configured as an input if its corresponding ddr bit is cleared to a logic 0. table 7-1. port a i/o pin functions ddra i/o pin mode access to ddra @ $0004 access to data register @ $0000 read/write read write 0 in, hi-z ddra0?dra7 i/o pin see note 1 out ddra0?dra7 pa0?a7 pa0?a7 note: does not affect input, but stored to data register table 7-2. port b i/o pin functions ddrb i/o pin mode access to ddrb @ $0005 access to data register @ $0001 read/write read write 0 in, hi-z ddrb5?drb7 i/o pin see note 1 out ddrb5?drb7 pb5?b7 pb5?b7 note: does not affect input, but stored to data register table 7-3. port c i/o pin functions ddrc i/o pin mode access to ddrc @ $0006 access to data register @ $0002 read/write read write 0 in, hi-z ddrc0?drc7 i/o pin see note 1 out ddrc0?drc7 pc0?c7 pc0?c7 note: does not affect input, but stored to data register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input/output (i/o) ports i/o port programming mc68HC05P18A technical data motorola input/output (i/o) ports 61 non-disclosure agreement required note: to avoid generating a glitch on an i/o port pin, data should be written to the i/o port data register before writing a logical 1 to the corresponding data direction register. table 7-4. port d i/o pin functions ddrd i/o pin mode access to ddrd @ $0007 access to data register @ $0003 read/write read write 0 in, hi-z ddrd5 i/o pin see note 1 out ddrd5 pd5/ckout pd5/ckout note: does not affect input, but stored to data register pd7 is input only. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required input/output (i/o) ports technical data mc68HC05P18A 62 input/output (i/o) ports motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola 16-bit timer 63 non-disclosure agreement required technical data mc68HC05P18A section 8. 16-bit timer 8.1 contents 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.3 timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65 8.4 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.5 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70 8.6 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72 8.7 timer status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 8.8 timer operation during wait mode and halt mode . . . . . . . . .74 8.9 timer operating during stop mode . . . . . . . . . . . . . . . . . . . . .74 8.2 introduction the mc68HC05P18A mcu contains a single 16-bit programmable timer with an input capture function and an output compare function. the 16- bit timer is driven by the output of a fixed divide-by-four prescaler operating from the ph2 clock. the 16-bit timer may be used for many applications, including input waveform measurement while simultaneously generating an output waveform. pulse widths can vary from microseconds to seconds depending on the oscillator frequency selected. the 16-bit timer is also capable of generating periodic interrupts. see figure 8-1 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 64 16-bit timer motorola figure 8-1. 16-bit timer block diagram edge detector compare detector overflow detector ph2 clock free- running counter internal hc05 bus timer status register output compare ocrh ocrl input capture icrh icrl ocf tcap 4 buffer tmrh/acrh tmrl/acrl tof icf ocie toie icie olvl iedg timer control register interrupt generator r tcmp d > q reset timer interrupt f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer timer mc68HC05P18A technical data motorola 16-bit timer 65 non-disclosure agreement required because the timer has a 16-bit architecture, each function is represented by two registers. each register pair contains the high and low byte of that function. generally, accessing the low byte of a specific timer function allows full control of that function; however, an access of the high byte inhibits that specific timer function until the low byte is also accessed. note: the i bit in the condition code register (ccr) should be set while manipulating both the high and low byte registers of a specific timer function. this prevents interrupts from occurring between the time that the high and low bytes are accessed. 8.3 timer the key element of the programmable timer is a 16-bit free-running counter, or timer registers, preceded by a prescaler, which divides the ph2 clock by four. the prescaler gives the timer a resolution of 2.0 ms when a 4-mhz crystal is used. the counter is incremented to increasing values during the low portion of the ph2 clock cycle. the double byte free-running counter can be read from either of two locations: the timer registers, tmrh and tmrl the alternate counter registers, acrh and acrl both locations will contain identical values. a read sequence containing only a read of the least-significant bit (lsb) of the counter (tmrl/acrl) returns the count value at the time of the read. if a read of the counter accesses the most-significant bit (msb) first (tmrh/acrh), it causes the lsb (tmrl/acrl) to be transferred to a buffer. this buffer value remains fixed after the first msb byte read even if the msb is read several times. the buffer is accessed when reading the counter lsb (tmrl/acrl), and thus completes a read sequence of the total counter value. when reading either the timer or alternate counter registers, if the msb is read, the lsb must also be read to complete the read sequence. see figure 8-2 and figure 8-3 . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 66 16-bit timer motorola the timer registers and alternate counter registers can be read at any time without affecting their values. however, the alternate counter registers differ from the timer registers in one respect: a read of the timer register msb can clear the timer overflow flag (tof). therefore, the alternate counter registers can be read at any time without the possibility address: $0018 bit 7 654321 bit 0 read: tmrh7 tmrh6 tmrh5 tmrh4 tmrh3 tmrh2 tmrh1 tmrh0 write: reset: 11111111 address: $0019 bit 7 654321 bit 0 read: tmrl7 tmrl6 tmrl5 tmrl4 tmrl3 tmrl2 tmrl1 tmrl0 write: reset: 11111111 = unimplemented figure 8-2. timer counter registers (tmrh/tmrl) address: $001a bit 7 654321 bit 0 read: acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 write: reset: 11111111 address: $001b bit 7 654321 bit 0 read: acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 write: reset: 11111111 = unimplemented figure 8-3. alternate counter registers (acrh/acrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer timer mc68HC05P18A technical data motorola 16-bit timer 67 non-disclosure agreement required of missing timer overflow interrupts due to clearing of the tof. see figure 8-4 . the free-running counter is initialized to $fffc during reset and is a read-only register. during power-on reset (por), the counter is initialized to $fffc and begins counting after the oscillator startup delay. since the counter is 16 bits preceded by a fixed divide-by-four prescaler, the value in the counter repeats every 262,144 ph2 clock cycles (524,288 oscillator cycles). when the free-running counter rolls over from $ffff to $0000, the timer overflow flag bit (tof) in the timer status register (tsr) is set. an interrupt can also be enabled when counter rollover occurs by setting the timer overflow interrupt enable bit (toie) in the timer control register (tcr). see figure 8-5 . figure 8-4. state timing diagram for timer overflow figure 8-5. state timing diagram for timer reset $fffe $ffff $0000 $0001 $0002 16-bit free-running counter timer overflow flag (tof) ph2 clock note: the tof bit is set at timer state t11 (transition of counter from $ffff to $0000). it is cleared by reading the timer status register (tsr) during the high portion of the ph2 clock followed by reading the lsb of the counter register pair (tcrl). note: the counter and control registers are the only 16-bit timer registers affected by reset. ph2 clock internal reset 16-bit free-running counter reset (external or other) $fffc $fffd $fffe $ffff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 68 16-bit timer motorola 8.4 output compare the output compare function may be used to generate an output waveform and/or as an elapsed time indicator. all of the bits in the output compare register pair, ocrh/ocrl, are readable and writable and are not altered by the 16-bit timer? control logic. reset does not affect the contents of these registers. if the output compare function is not utilized, its registers may be used for data storage. see figure 8-6 . the contents of the output compare registers are compared with the contents of the free-running counter once every four ph2 clock cycles. if a match is found, the output compare flag bit (ocf) is set and the output level bit (olvl) is clocked to the output latch. the values in the output compare registers and output level bit should be changed after each successful comparison to control an output waveform or to establish a new elapsed timeout. an interrupt can also accompany a successful output compare if the output compare interrupt enable bit (ocie) is set. after a cpu write cycle to the msb of the output compare register pair (ocrh), the output compare function is inhibited until the lsb (ocrl) is written. both bytes must be written if the msb is written. a write made only to the lsb will not inhibit the compare function. the free-running address: $0016 bit 7 654321 bit 0 read: ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 write: reset: unaffected by reset address: $0017 bit 7 654321 bit 0 read: ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 write: reset: unaffected by reset figure 8-6. output compare registers (ocrh/ocrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer output compare mc68HC05P18A technical data motorola 16-bit timer 69 non-disclosure agreement required counter increments every four ph2 clock cycles. the minimum time required to update the output compare registers is a function of software rather than hardware. the output compare output level bit (olvl) will be clocked to its output latch regardless of the state of the output compare flag bit (ocf). a valid output compare must occur before the olvl bit is clocked to its output latch (tcmp). since neither the output compare flag (ocf) nor the output compare registers are affected by reset, care must be exercised when initializing the output compare function. this procedure is recommended: 1. block interrupts by setting the i bit in the condition code register (ccr). 2. write the msb of the output compare register pair (ocrh) to inhibit further compares until the lsb is written. 3. read the timer status register (tsr) to arm the output compare flag (ocf). 4. write the lsb of the output compare register pair (ocrl) to enable the output compare function and to clear its flag and interrupt. 5. unblock interrupts by clearing the i bit in the ccr. this procedure prevents the output compare flag bit (ocf) from being set between the time it is read and the time the output compare registers are updated. a software example is shown in figure 8-7 . 9b b6 be b7 b6 bf xx xx 16 13 17 sei lda ldx sta lda stx data h data l ocrh tsr ocrl block interrupts hi byte for compare low byte for compare inhibit output compare arm ocf bit to clear ready for next compare figure 8-7. output compare software initialization example f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 70 16-bit timer motorola 8.5 input capture two 8-bit read-only registers (icrh and icrl) make up the 16-bit input capture. they are used to latch the value of the free-running counter after a defined transition is sensed by the input capture edge detector. note: the input capture edge detector contains a schmitt trigger to improve noise immunity. the edge that triggers the counter transfer is defined by the input edge bit (iedg) in tcr. reset does not affect the contents of the input capture registers. see figure 8-8 . the result obtained by an input capture will be one more than the value of the free-running counter on the rising edge of the ph2 clock preceding the external transition (see figure 8-9 ). this delay is required for internal synchronization. resolution is affected by the prescaler, allowing the free-running counter to increment once every four ph2 clock cycles. the contents of the free-running counter are transferred to the input capture registers on each proper signal transition regardless of the state of the input capture flag bit (icf) in register tsr. the input capture registers always contain the free-running counter value which corresponds to the most recent input capture. address: $0014 bit 7 654321 bit 0 read: icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 write: reset: unaffected by reset address: $0015 bit 7 654321 bit 0 read: icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 write: reset: unaffected by reset figure 8-8. input capture registers (icrh/icrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer input capture mc68HC05P18A technical data motorola 16-bit timer 71 non-disclosure agreement required after a read of the msb of the input capture register pair (icrh), counter transfers are inhibited until the lsb of the register pair (icrl) is also read. this characteristic forces the minimum pulse period attainable to be determined by the time required to execute an input capture software routine in an application. reading the lsb of the input capture register pair (icrl) does not inhibit transfer of the free-running counter. again, minimum pulse periods are ones which allow software to read the lsb of the register pair (icrl) and perform needed operations. there is no conflict between reading the lsb (icrl) and the free-running counter transfer since they occur on opposite edges of the ph2 clock. figure 8-9. state timing diagram for input capture input capture flag input capture register 16-bit free-running counter tcap pin input capture latch ph2 clock note: if the input edge occurs in the shaded area from one t10 timer state to the other t10 timer state, the input capture ?g is set during the next t11 timer state. $ffec $ffed $ffee $ffef $ffeb $ffed (see note) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 72 16-bit timer motorola 8.6 timer control register the timer control (tcr) shown in figure 8-10 and free-running counter (tmrh, tmrl, acrh, acrl) registers are the only registers of the 16- bit timer affected by reset. the output compare port (tcmp) is forced low after reset and remains low until olvl is set and a valid output compare occurs. icie ?input capture interrupt enable bit bit 7, when set, enables input capture interrupts to the cpu. the interrupt will occur at the same time bit 7 (icf) in the tsr register is set. ocie ?output comapre interrupt enable bit bit 6, when set, enables output compare interrupts to the cpu. the interrupt will occur at the same time bit 6 (ocf) in the tsr register is set. toie ?timer overflow interrupt enable bit bit 5, when set, enables timer overflow (rollover) interrupts to the cpu. the interrupt will occur at the same time bit 5 (tof) in the tsr register is set. iedg ?input capture edge select bit bit 1 selects which edge of the input capture signal will trigger a transfer of the contents of the free-running counter registers to the input capture registers. clearing this bit will select the falling edge, setting it selects the rising edge. address: $0012 bit 7 654321 bit 0 read: icie ocie toie 000 iedg olvl write: reset: 000000u0 = unimplemented u = unaffected figure 8-10. timer control register (tcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer timer status register mc68HC05P18A technical data motorola 16-bit timer 73 non-disclosure agreement required olvl ?output compare output level select bit bit 0 selects the output level (high or low) that is clocked into the output compare output latch at the next successful output compare. 8.7 timer status register reading the timer status register (tsr) satisfies the first condition required to clear status flags and interrupts (see figure 8-11 ). the only remaining step is to read (or write) the register associated with the active status flag (and/or interrupt). this method does not present any problems for input capture or output compare functions. however, a problem can occur when using a timer interrupt function and reading the free-running counter at random times to, for example, measure an elapsed time. if the proper precautions are not designed into the application software, a timer interrupt flag (tof) could unintentionally be cleared if: 1. the tsr is read when bit 5 (tof) is set. 2. the lsb of the free-running counter is read, but not for the purpose of servicing the flag or interrupt. the alternate counter registers (acrh and acrl) contain the same values as the timer registers (tmrh and tmrl). registers acrh and acrl can be read at any time without affecting the timer overflow flag (tof) or interrupt. address: $0013 bit 7 654321 bit 0 read: icf ocf tof 00000 write: reset: u u u 00000 = unimplemented u = unaffected figure 8-11. timer status register (tsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 74 16-bit timer motorola icf ?input capture flag bit 7 is set when the edge specified by iedg in register tcr has been sensed by the input capture edge detector fed by pin tcap. this flag, and the input capture interrupt, can be cleared by reading register tsr followed by reading the lsb of the input capture register pair (icrl). ocf ?output compare bit bit 6 is set when the contents of the output compare registers match the contents of the free-running counter. this flag, and the output compare interrupt, can be cleared by reading register tsr followed by writing the lsb of the output compare register pair (ocrl). tof ?timer overflow flag bit 5 is set by a rollover of the free-running counter from $ffff to $0000. this flag, and the timer overflow interrupt, can be cleared by reading register tsr followed by reading the lsb of the timer register pair (tmrl). 8.8 timer operation during wait mode and halt mode during wait mode and halt mode the 16-bit timer continues to operate normally and may generate an interrupt to trigger the mcu out of the wait mode and halt mode. 8.9 timer operating during stop mode when the mcu enters the stop mode, the free-running counter stops counting. (the ph2 clock is stopped.) it remains at that particular count value until the stop mode is exited by applying a low signal to the irq pin, at which time the counter resumes from its stopped value as if nothing had happened. if stop mode is exited via an external reset (logic low applied to the reset pin), the counter is forced to $fffc. if a valid input capture edge occurs at the tcap pin during stop mode, the input capture detect circuitry is armed. this action does not set any flags or wake up the mcu, but when the mcu does wake up there will f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
16-bit timer timer operating during stop mode mc68HC05P18A technical data motorola 16-bit timer 75 non-disclosure agreement required be an active input capture flag (and data) from the first valid edge. if the stop mode is exited by an external reset, no input capture flag or data will be present even if a valid input capture edge was detected during stop mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required 16-bit timer technical data mc68HC05P18A 76 16-bit timer motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola serial input/output ports (siop) 77 non-disclosure agreement required technical data mc68HC05P18A section 9. serial input/output ports (siop) 9.1 contents 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77 9.3 siop signal format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.1 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.3.2 serial data input (sdi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.3.3 serial data output (sdo). . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.4 siop registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.4.1 siop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 9.4.2 siop status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 9.4.3 siop data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 9.2 introduction the simple synchronous serial input/output (i/o) port (siop) subsystem is designed to provide efficient serial communications between peripheral devices or other mcus. the siop is implemented as a 3-wire master/slave system with: serial clock (sck) serial data input (sdi) serial data output (sdo) a block diagram of the siop is shown in figure 9-1 . the siop subsystem shares its input/output pins with port b. when the siop is enabled, spe bit set in the siop control register (scr), port b data direction register (ddr), and data register are modified by the siop. although port b ddr and data registers can be altered by f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required serial input/output ports (siop) technical data mc68HC05P18A 78 serial input/output ports (siop) motorola application software, these actions could affect the transmitted or received data. figure 9-1. siop block diagram 9.3 siop signal format the siop subsystem is software configurable for master or slave operation. there are no external mode selection inputs available (for example, slave select pin). 9.3.1 serial clock (sck) the state of the sck output normally remains a logic 1 during idle periods between data transfers. the first falling edge of sck signals the beginning of a data transfer. at this time the first bit of received data is accepted at the sdi pin and the first bit of transmitted data is presented at the sdo pin (see figure 9-2 ). data is captured at the sdi pin on the rising edge of sck, and the first bit of transmitted data is presented at the sdo pin. the transfer is terminated upon the eighth rising edge of sck. 8-bit shift register status register baud rate control register generator hco5 internal bus ph2 clock sck sdi sdo 76543210 76543210 76543210 i/o $0b $0c $0a control logic spe sdi/pb6 sck/pb7 sdo/pb5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial input/output ports (siop) siop signal format mc68HC05P18A technical data motorola serial input/output ports (siop) 79 non-disclosure agreement required figure 9-2. siop timing diagram the master and slave modes of operation differ only by the sourcing of sck. in master mode, sck is driven from an internal source within the mcu. in slave mode, sck is driven from a source external to the mcu. the sck frequency is mask option selectable. available rates are osc divided by 2, 4, 8, or 16. note: osc divided by 2 is four times faster than the standard rate available on the 68hc05p6. refer to 1.4 mask options for a description of available mask options. 9.3.2 serial data input (sdi) the sdi pin becomes an input as soon as the siop subsystem is enabled. new data is presented to the sdi pin on the falling edge of sck. valid data must be present at least 100 ns before the rising edge of sck and remain valid for 100 ns after the rising edge of sck. see figure 9-2 . 9.3.3 serial data output (sdo) the sdo pin becomes an output as soon as the siop subsystem is enabled. prior to enabling the siop, pb5 can be initialized to determine the beginning state. while the siop is enabled, pb5 cannot be used as a standard output since that pin is connected to the last stage of the siop serial shift register. a mask option is included to allow the data to sck sdo sdi 100 ns 100 ns bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required serial input/output ports (siop) technical data mc68HC05P18A 80 serial input/output ports (siop) motorola be transmitted in either most-significant bit (msb) first format or the least-significant bit (lsb) format. on the first falling edge of sck, the first data bit will be shifted out to the sdo pin. the remaining data bits will be shifted out to the sdi pin on subsequent falling edges of sck. the sdo pin will present valid data at least 100 ns before the rising edge of the sck and remain valid for 100 ns after the rising edge of sck. see figure 9-2 . 9.4 siop registers the siop is programmed and controlled by these registers: siop control register (scr) located at address $000a siop status register (ssr) located at address $000b siop data register (sdr) located at address $000c 9.4.1 siop control register this register is located at address $000a and contains two bits. figure 9-3 shows the position of each bit in the register and indicates the value of each bit after reset. address: $000a bit 7 654321 bit 0 read: 0 spe 0 mstr 0000 write: reset: 00000000 = unimplemented figure 9-3. siop control register (scr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial input/output ports (siop) siop registers mc68HC05P18A technical data motorola serial input/output ports (siop) 81 non-disclosure agreement required spe ?serial peripheral enable bit when set, the spe bit enables the siop subsystem such that sdo/pb5 is the serial data output, sdi/pb6 is the serial data input, and sck/pb7 is a serial clock input in the slave mode or a serial clock output in the master mode. the port b ddr and data registers can be manipulated as usual (except for pb5); however, these actions could affect the transmitted or received data. the spe bit is readable and writable at any time. clearing the spe bit while a transmission is in progress will: 1. abort the transmission 2. reset the serial bit counter 3. convert the port b/siop port to a general-purpose i/o port reset clears the spe bit. mstr ?master mode select bit when set, the mstr bit configures the serial i/o port for master mode. a transfer is initiated by writing to the sdr. also, the sck pin becomes an output providing a synchronous data clock dependent upon the oscillator frequency. when the device is in slave mode, the sdo and sdi pins do not change function. these pins behave exactly the same in both the master and slave modes. the mstr bit is readable and writable at any time regardless of the state of the spe bit. clearing the mstr bit will abort any transfers that may have been in progress. reset clears the mstr bit, placing the siop subsystem in slave mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required serial input/output ports (siop) technical data mc68HC05P18A 82 serial input/output ports (siop) motorola 9.4.2 siop status register this register is located at address $000b and contains two bits. figure 9-4 shows the position of each bit in the register and indicates the value of each bit after reset. spif ?serial port interface flag spif is a read-only status bit that is set on the last rising edge of sck and indicates that a data transfer has been completed. it has no effect on any future data transfers and can be ignored. the spif bit is cleared by reading the ssr followed by a read or write of the sdr. if the spif is cleared before the last rising edge of sck it will be set again on the last rising edge of sck. reset clears the spif bit. dcol ?data collision bit dcol is a read-only status bit, which indicates that an illegal access of the sdr has occurred. the dcol bit will be set when reading or writing the sdr after the first falling edge of sck and before spif is set. reading or writing the sdr during this time will result in invalid data being transmitted or received. the dcol bit is cleared by reading the ssr (when the spif bit is set) followed by a read or write of the sdr. if the last part of the clearing sequence is done after another transfer has started, the dcol bit will be set again. reset clears the dcol bit. address: $000b bit 7 654321 bit 0 read: spif dcol 000000 write: reset: 00000000 = unimplemented figure 9-4. siop status register (ssr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
serial input/output ports (siop) siop registers mc68HC05P18A technical data motorola serial input/output ports (siop) 83 non-disclosure agreement required 9.4.3 siop data register this register is located at address $000c and serves as both the transmit and receive data register. writing to this register will initiate a message transmission if the siop is in master mode. the siop subsystem is not double buffered and any write to this register will destroy the previous contents. the sdr can be read at any time; however, if a transfer is in progress, the results may be ambiguous and the dcol bit will be set. writing to the sdr while a transfer is in progress can cause invalid data to be transmitted and/or received. figure 9-5 shows the position of each bit in the register. this register is not affected by reset. address: $000c bit 7 654321 bit 0 read: sd7 sd6 sd5 sd4 sd3 sd2 sd1 sd0 write: reset: unaffected by reset figure 9-5. siop data register (sdr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required serial input/output ports (siop) technical data mc68HC05P18A 84 serial input/output ports (siop) motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola eeprom 85 non-disclosure agreement required technical data mc68HC05P18A section 10. eeprom 10.1 contents 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 10.3 eeprom programming register . . . . . . . . . . . . . . . . . . . . . . .86 10.4 programming/erasing procedures . . . . . . . . . . . . . . . . . . . . . .88 10.2 introduction the electrically erasable programmable read-only memory (eeprom) is located at address $0140 and consists of 128 bytes. programming the eeprom can be done by the user on a single byte basis by manipulating the programming register, located at address $001c. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required eeprom technical data mc68HC05P18A 86 eeprom motorola 10.3 eeprom programming register the contents and use of the programming register (eeprog) are discussed here. cpen ?charge pump enable bit when set, cpen enables the charge pump that produces the internal eeprom programming voltage. this bit should be set concurrently with the latch bit. the programming voltage will not be available until eepgm is set. the charge pump should be disabled when not in use. cpen is readable and writable and is cleared by reset. er1 and er0 ?erase select bits er1 and er0 form a 2-bit field that is used to select one of three erase modes: byte, block, or bulk. table 10-1 shows the modes selected for each bit configuration. these bits are readable and writable and are cleared by reset. address: $001c bit 7 654321 bit 0 read: 0 cpen 0 er1 er0 latch eerc eepgm write: reset: 00000000 = unimplemented figure 10-1. eeprom programming register (eeprog) table 10-1. erase mode select er1 er0 mode 0 0 program, no erase 0 1 byte erase 1 0 block erase 1 1 bulk erase f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
eeprom eeprom programming register mc68HC05P18A technical data motorola eeprom 87 non-disclosure agreement required in byte erase mode, only the selected byte is erased. in block mode, a 32-byte block of eeprom is erased. the eeprom memory space is divided into four 32-byte blocks ($140?15f, $160?17f, $180?19f, $1a0?1bf), and doing a block erase to any address within a block erases the entire block. in bulk erase mode, the entire 128-byte eeprom section is erased. latch ?eeprom programming latch bit when set, latch configures the eeprom address and data bus for programming. when latch is set, writes to the eeprom array cause the data bus and the address bus to be latched. this bit is readable and writable, but reads from the array are inhibited if the latch bit is set and a write to the eeprom space has taken place. when clear, address and data buses are configured for normal operation. reset clears this bit. eerc ?eeprom rc oscillator control bit when this bit is set, the eeprom section uses the internal rc oscillator instead of the cpu clock. the rc oscillator is shared with the analog-to-digital (a/d) converter, so this bit should be set by the user when the internal bus frequency is below 1.5 mhz to guarantee reliable operation of the eeprom or a/d converter. after setting the eerc bit, delay a time, t rcon , to allow the rc oscillator to stabilize. this bit is readable and writable. the eerc bit is cleared by reset. the rc oscillator is disabled while the mcu is in stop mode. eepgm ?eeprom programming power enable bit eepgm must be written to enable (or disable) the eepgm function. when set, eepgm turns on the charge pump and enables the programming (or erasing) power to the eeprom array. when clear, this power is switched off. this enables pulsing of the programming voltage to be controlled internally. this bit can be read at any time, but can only be written to if latch = 1. if latch is not set, eepgm cannot be set. latch and eepgm cannot both be set with one write if latch is cleared. eepgm is cleared automatically when latch is cleared. reset clears this bit. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required eeprom technical data mc68HC05P18A 88 eeprom motorola 10.4 programming/erasing procedures to program a byte of eeprom: 1. set eelat = cpen = 1. 2. set er1 = er0 = 0. 3. write data to the desired address. 4. set eepgm for a time, t eepgm . any bit should be erased before it is programmed. however, if write/erase cycling is a concern, a procedure can be followed to minimize the cycling of each bit in each eeprom byte. here is the procedure: if pb eb = 0 ?program the new data over the existing data without erasing it first. if pb eb 0 ?erase byte before programming. where: pb = byte data to be programmed eb = existing eeprom byte data to erase a byte of eeprom: 1. set latch = 1, cpen = 1, er1 = 0, and er0 = 1. 2. write to the address to be erased. 3. set eepgm for a time, t ebyt . to erase a block of eeprom: 1. set latch = 1, cpen = 1, er1 = 1, and er0 = 0. 2. write to any address in the block. 3. set eepgm for a time, t eblock . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
eeprom programming/erasing procedures mc68HC05P18A technical data motorola eeprom 89 non-disclosure agreement required for a bulk erase: 1. set latch = 1, cpen = 1, er1 = 1, and er0 = 1. 2. write to any address in the array. 3. set eepgm for a time, t ebulk . to terminate the programming or erase sequence, clear eepgm, delay for a time, t fpv , to allow the programming voltage to fall, and then clear latch and cpen to free up the buses. following each erase or programming sequence, clear all programming control bits. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required eeprom technical data mc68HC05P18A 90 eeprom motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola analog-to-digital (a/d) converter 91 non-disclosure agreement required technical data mc68HC05P18A section 11. analog-to-digital (a/d) converter 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 11.3 analog section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.3.1 ratiometric conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.3.2 reference supply voltage (v refh ) . . . . . . . . . . . . . . . . . . .92 11.3.3 accuracy and precision . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.4 conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 11.5 digital section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 11.5.1 conversion times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 11.5.2 internal versus external oscillator . . . . . . . . . . . . . . . . . . . .93 11.5.3 multi-channel operation . . . . . . . . . . . . . . . . . . . . . . . . . . .94 11.6 a/d status and control register. . . . . . . . . . . . . . . . . . . . . . . .94 11.7 a/d conversion data register . . . . . . . . . . . . . . . . . . . . . . . . .96 11.8 a/d subsystem operation during wait mode and halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96 11.9 a/d subsystem operation during stop mode. . . . . . . . . . . . . .96 11.2 introduction the mc68HC05P18A includes a 4-channel, multiplexed input, 8-bit, successive approximation analog-to-digital (a/d) converter. the a/d subsystem shares its inputs with port c pins pc3?c7. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required analog-to-digital (a/d) converter technical data mc68HC05P18A 92 analog-to-digital (a/d) converter motorola 11.3 analog section the following paragraphs describe the operation and performance of analog modules within the analog subsystem. 11.3.1 ratiometric conversion the a/d converter is ratiometric, with pin v refh supplying the high reference voltage. applying an input voltage equal to v refh produces a conversion result of $ff (full scale). applying an input voltage equal to v ss produces a conversion result of $00. an input voltage greater than v refh converts to $ff with no overflow indication. for ratiometric conversions, v refh should be at the same potential as the supply voltage being used by the analog signal being measured and be referenced to v ss . 11.3.2 reference supply voltage (v refh ) the reference supply for the a/d converter shares pin pc7 with port c. the low reference is tied to the v ss pin internally. v refh can be any voltage between v ss and v dd ; however, the accuracy of conversions is tested and guaranteed only for v refh = v dd . 11.3.3 accuracy and precision the 8-bit conversion result is accurate to within 1 1/2 lsb (least significant bit), including quantization; however, the accuracy of conversions is tested and guaranteed only with external oscillator operation. 11.4 conversion process the a/d reference inputs are applied to a precision digital-to-analog (d/a) converter. control logic drives the d/a and the analog output is successively compared to the selected analog input that was sampled at f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter digital section mc68HC05P18A technical data motorola analog-to-digital (a/d) converter 93 non-disclosure agreement required the beginning of the conversion cycle. the conversion process is monotonic and has no missing codes. 11.5 digital section the following paragraphs describe the operation and performance of digital modules within the analog subsystem. 11.5.1 conversion times each input conversion requires 32 ph2 clock cycles, which must be at a frequency equal to or greater than 1 mhz. 11.5.2 internal versus external oscillator if the mcu ph2 clock frequency is less than 1 mhz (2 mhz external oscillator), the internal rc oscillator (approximately 1.5 mhz) must be used for the a/d converter clock. the internal rc clock is selected by setting the eerc bit in the eeprom program register (eeprog). note: the rc oscillator is shared with the eeprom module. the rc oscillator is disabled while the mcu is in stop mode. when the internal rc oscillator is being used, these limitations apply: 1. since the internal rc oscillator is running asynchronously with respect to the ph2 clock, the conversion complete (cc) bit in the a/d status and control register (adsc) must be used to determine when a conversion sequence has been completed. 2. electrical noise slightly degrades the accuracy of the a/d converter. the a/d converter is synchronized to read voltages during the quiet period of the clock driving it. since the internal and external clocks are not synchronized, the a/d converter occasionally measures an input when the external clock is making a transition. 3. if the ph2 clock is 1 mhz or greater (for example, external oscillator 2 mhz or greater), the internal rc oscillator should be turned off and the external oscillator used as the conversion clock. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required analog-to-digital (a/d) converter technical data mc68HC05P18A 94 analog-to-digital (a/d) converter motorola 11.5.3 multi-channel operation an input multiplexer allows the a/d converter to select from one of four external analog signals. port c pins pc3?c6 are shared with the inputs to the multiplexer. 11.6 a/d status and control register the a/d status and control register (adscr) reports the completion of a/d conversion and provides control over: oscillator selection analog subsystem power input channel selection see figure 11-1 . cc ?conversion complete bit this read-only status bit is set when a conversion sequence has completed and data is ready to be read from the adc register. cc is cleared when a channel is selected for conversion, when data is read from the adc register, or when the a/d subsystem is turned off. once a conversion is started, conversions of the selected channel continue every 32 ph2 clock cycles until the adsc register is written to again. during continuous conversion operation, the adc register is updated with new data, and the cc bit is set, every 32 ph2 clock cycles. also, data from the previous conversion is overwritten regardless of the state of the cc bit. address: $001e bit 7 654321 bit 0 read: cc r adon 00 ch2 ch1 ch0 write: reset: 00000000 = unimplemented r = reserved figure 11-1. a/d status and control register (adscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
analog-to-digital (a/d) converter a/d status and control register mc68HC05P18A technical data motorola analog-to-digital (a/d) converter 95 non-disclosure agreement required r ?reserved bit this bit is not currently used. it can be read or written, but does not control anything. adon ?a/d subsystem on bit when the a/d subsystem is turned on (adon = 1), it requires a time t adon to stabilize before accurate conversion results can be attained. ch2?h0 ?channel select bits ch2, ch1, and ch0 form a 3-bit field that is used to select an input to the a/d converter. channels 0? correspond to port c input pins pc6?c3. channels 4? are used for reference measurements. in user mode, channel 7 is reserved. if a conversion is attempted with channel 7 selected, the result is $00. table 11-1 lists the inputs selected by bits ch0?h3. if the adon bit is set, and an input from channels 0? is selected, the corresponding port c pin? ddr bit is cleared (making that port c pin an input). if the port c data register is read while the a/d is on, and one of the shared input channels is selected using bit ch0?h2, the corresponding port c pin reads as a logic 0. the remaining port c pins read normally. to digitally read a port c pin, the a/d subsystem must be disabled (adon = 0) or input channel 5? must be selected. table 11-1. a/d multiplexer input channel assignments channel signal 0 ad0 port c bit 6 1 ad1 port c bit 5 2 ad2 port c bit 4 3 ad3 port c bit 3 4v refh port c bit 7 5(v refh + v ss )/2 6v ss 7 reserved f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required analog-to-digital (a/d) converter technical data mc68HC05P18A 96 analog-to-digital (a/d) converter motorola 11.7 a/d conversion value data register this register contains the output of the a/d converter. see figure 11-2 . 11.8 a/d subsystem operation during wait mode and halt mode the a/d subsystem continues normal operation during wait mode and halt mode. to decrease power consumption during wait or halt, the adon bit in the adsc register and the eerc bit in the eeprog register should be cleared if the a/d subsystem is not being used. 11.9 a/d subsystem operation during stop mode when stop mode is enabled, execution of the stop instruction terminates all a/d subsystem functions. any pending conversion is aborted. when the oscillator resumes operation upon leaving the stop mode, a finite amount of time passes before the a/d subsystem stabilizes sufficiently to provide conversions at its rated accuracy. the delays built into the mc68HC05P18A when coming out of stop mode are sufficient for this purpose. no explicit delays need to be added to the application software. address: $001d bit 7 654321 bit 0 read: ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 write: reset: unaffected by reset = unimplemented r = reserved figure 11-2. a/d conversion value data register (adc) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola instruction set 97 non-disclosure agreement required technical data mc68HC05P18A section 12. instruction set 12.1 contents 12.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 12.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98 12.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 12.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.7 indexed,16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100 12.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 12.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 12.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .102 12.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .103 12.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .104 12.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .106 12.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 12.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .108 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 98 instruction set motorola 12.2 introduction the mcu instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator. 12.3 addressing modes the cpu uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are: inherent immediate direct extended indexed, no offset indexed, 8-bit offset indexed, 16-bit offset relative f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set addressing modes mc68HC05P18A technical data motorola instruction set 99 non-disclosure agreement required 12.3.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 12.3.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte. 12.3.3 direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. 12.3.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 100 instruction set motorola 12.3.5 indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000?00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 12.3.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000?01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 12.3.7 indexed,16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction types mc68HC05P18A technical data motorola instruction set 101 non-disclosure agreement required 12.3.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, two? complement byte that gives a branching range of ?28 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch. 12.4 instruction types the mcu instructions fall into five categories: register/memory instructions read-modify-write instructions jump/branch instructions bit manipulation instructions control instructions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 102 instruction set motorola 12.4.1 register/memory instructions these instructions operate on cpu registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 12-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction types mc68HC05P18A technical data motorola instruction set 103 non-disclosure agreement required 12.4.2 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read-modify-write operations on write-only registers. table 12-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. bit set bset (1) clear register clr complement (ones complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (two? complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 2. tst is an exception to the read-modify-write sequence because it does not write a replacement value. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 104 instruction set motorola 12.4.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ?28 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction types mc68HC05P18A technical data motorola instruction set 105 non-disclosure agreement required table 12-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 106 instruction set motorola 12.4.4 bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. table 12-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction types mc68HC05P18A technical data motorola instruction set 107 non-disclosure agreement required 12.4.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 12-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 108 instruction set motorola 12.5 instruction set summary table 12-6. instruction set summary (sheet 1 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a (a) + (m) + (c) ? ??? imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a (a) + (m) ? ??? imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a (a) (m) ?? imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) ??? dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right ??? dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc (pc) + 2 + rel ? h = 0 rel 28 rr 3 bhcs rel branch if half-carry bit set pc (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc (pc) + 2 + rel ? c = 0 rel 24 rr 3 c b0 b7 0 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction set summary mc68HC05P18A technical data motorola instruction set 109 non-disclosure agreement required bih rel branch if irq pin high pc (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) ?? imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc (pc) + 2 + rel ? mn = 0 ? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 brset n opr rel branch if bit n set pc (pc) + 2 + rel ? mn = 1 ? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 bset n opr set bit n mn 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc (pc) + 2; push (pcl) sp (sp) ?1; push (pch) sp (sp) ?1 pc (pc) + rel rel ad rr 6 clc clear carry bit c 0 0 inh 98 2 cli clear interrupt mask i 0 0 inh 9a 2 table 12-6. instruction set summary (sheet 2 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 110 instruction set motorola clr opr clra clrx clr opr ,x clr ,x clear byte m $00 a $00 x $00 m $00 m $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ?(m) ??? imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (ones complement) m ( m) = $ff ?(m) a ( a) = $ff ?(a) x ( x) = $ff ?(x) m ( m) = $ff ?(m) m ( m) = $ff ?(m) ?? 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ?(m) ??? imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m (m) ?1 a (a) ?1 x (x) ?1 m (m) ?1 m (m) ?1 ?? dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a (a) (m) ?? imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m (m) + 1 a (a) + 1 x (x) + 1 m (m) + 1 m (m) + 1 ?? dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 table 12-6. instruction set summary (sheet 3 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction set summary mc68HC05P18A technical data motorola instruction set 111 non-disclosure agreement required jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc (pc) + n (n = 1, 2, or 3) push (pcl); sp (sp) ?1 push (pch); sp (sp) ?1 pc effective address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a (m) ?? imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x (m) ?? imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) ??? dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 ?? dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a (x) (a) 0 0 inh 42 1 1 neg opr nega negx neg opr ,x neg ,x negate byte (twos complement) m ?m) = $00 ?(m) a ?a) = $00 ?(a) x ?x) = $00 ?(x) m ?m) = $00 ?(m) m ?m) = $00 ?(m) ??? dir inh inh ix1 ix 30 40 50 60 70 dd ff 5 3 3 6 5 nop no operation inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a (a) (m) ?? imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit ??? dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 table 12-6. instruction set summary (sheet 4 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required instruction set technical data mc68HC05P18A 112 instruction set motorola ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit ??? dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp $00ff inh 9c 2 rti return from interrupt sp (sp) + 1; pull (ccr) sp (sp) + 1; pull (a) sp (sp) + 1; pull (x) sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) ????? inh 80 9 rts return from subroutine sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a (a) ?(m) ?(c) ??? imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c 1 1 inh 99 2 sei set interrupt mask i 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m (a) ?? dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m (x) ?? dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a (a) ?(m) ??? imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc (pc) + 1; push (pcl) sp (sp) ?1; push (pch) sp (sp) ?1; push (x) sp (sp) ?1; push (a) sp (sp) ?1; push (ccr) sp (sp) ?1; i 1 pch interrupt vector high byte pcl interrupt vector low byte 1 inh 83 1 0 tax transfer accumulator to index register x (a) inh 97 2 table 12-6. instruction set summary (sheet 5 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set instruction set summary mc68HC05P18A technical data motorola instruction set 113 non-disclosure agreement required tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ?$00 ?? dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a (x) inh 9f 2 wait stop cpu clock and enable interrupts 0 inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow ?g pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry ?g z zero ?g hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ) negation (twos complement) ix1 indexed, 8-bit offset addressing mode loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative ?g ? set or cleared n any bit not affected table 12-6. instruction set summary (sheet 6 of 6) source form operation description effect on ccr address mode opcode operand cycles hinzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required technical data mc68HC05P18A 114 instruction set motorola instruction set table 12-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789 abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 ta x 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola electrical specifications 115 non-disclosure agreement required technical data mc68HC05P18A section 13. electrical specifications 13.1 contents 13.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 13.3 operating temperature range. . . . . . . . . . . . . . . . . . . . . . . .116 13.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 13.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 13.6 dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . .118 13.7 active reset characteristics. . . . . . . . . . . . . . . . . . . . . . . . . .119 13.8 a/d converter characteristics . . . . . . . . . . . . . . . . . . . . . . . .120 13.9 siop timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 13.10 pd5 clock out timing (pd5 clock out option enabled) . . . .122 13.11 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required electrical speci?ations technical data mc68HC05P18A 116 electrical specifications motorola 13.2 maximum ratings maximum ratings are the extreme limits to which the mcu can be exposed without permanently damaging it. the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table here. keep v in and v out within the range v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . note: this device is not guaranteed to operate properly at the maximum ratings. refer to 13.6 dc electrical characteristics for guaranteed operating conditions. 13.3 operating temperature range 13.4 thermal characteristics rating symbol value unit supply voltage v dd ?.3 to +7.0 v input voltage v in v ss ?.3 to v dd +0.3 v current drain per pin excluding v dd and v ss i25ma storage temperature range t stg ?5 to +150 c characteristic symbol value unit operating temperature range standard extended automotive t a t l to t h 0 to +70 ?0 to +85 ?0 to +125 c maximum junction temperature t j 150 c characteristic symbol value unit thermal resistance pdip (28 pin) soic (28 pin) ja 60 60 c/w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications power considerations mc68HC05P18A technical data motorola electrical specifications 117 non-disclosure agreement required 13.5 power considerations the average chip junction temperature, t j , in c can be obtained from: t j = t a + (p d x ja ) (1) where: t a = ambient temperature in c ja = package thermal resistance, junction to ambient in c/w p d = p int + p i/o p int = i cc v cc = chip internal power dissipation p i/o = power dissipation on input and output pins (user-determined) for most applications, p i/o p int and can be neglected. ignoring p i/o , the relationship between p d and t j is approximately: (2) solving equations (1) and (2) for k gives: = p d x (t a + 273 c) + ja x (p d ) 2 (3) where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a . p d = t j + 273 c k f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required electrical speci?ations technical data mc68HC05P18A 118 electrical specifications motorola 13.6 dc electrical characteristics characteristic (1) symbol min max unit output voltage i load = 10.0 a v ol v oh v dd ?.1 0.1 v output high voltage (i load ? 0.8 ma) pa0?a7, pb5?b7, pc0?c7, pd5/ckout (i load ? 5 ma) pc0, pc1 v oh v dd ?.8 ? output low voltage (i load = 1.6 ma) pa0?a7, pb5?b7, pc0?c7, pd5/ckout (i load = 10 ma) pc0, pc1 v ol 0.4 v input high voltage pa0?a7, pb5?b7, pc0?c7, pd5/ckout, tcap/pd7, irq, reset, osc1 v ih 0.7xv dd v dd v input low voltage pa0?a7, pb5?b7, pc0?c7, pd5, tcap/pd7, irq, reset, osc1 v il v ss 0.3 x v dd v supply current (2) (3) (4) low frequency (2-mhz bus) run wait (a2d on) wait (a2d off) high frequency (4-mhz bus) run wait (a2d on) wait (a2d off) stop (?0 c to +132 c) lvr disabled lvr enabled i dd 4 3.5 2.5 6 4.5 4.6 50 200 ma ma ma ma ma ma a a i/o ports hi-z leakage current pa0?a7, pb5?b7, pc0?c7, pd5/ckout, tcap/pd7 i il 10 a i/o ports switch resistance (pullup enabled pa0?a7) r pta 730k a/d ports hi-z leakage current pc3?c7 i in 1 a input current reset, irq, osc1 i in 1 a capacitance ports (as input or output) reset, irq c out c in 12 8 pf continued f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications active reset characteristics mc68HC05P18A technical data motorola electrical specifications 119 non-disclosure agreement required 13.7 active reset characteristics eeprom program/erase time byte block bulk 5 30 100 ms low-voltage reset inhibit v lvri 3.5 4.3 v 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ?0 c to +125 c, unless otherwise noted. all values shown re?ct average measurements. 2. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 (f osc = 4.2 mhz), all inputs 0.2 vdc from rail; no dc loads, less than 50 pf on all outputs, c l = 20 pf on osc2 3. wait i dd : only timer system active wait i dd is affected linearly by the osc2 capacitance. wait, stop i dd : all ports configured as inputs, v il = 0.2 vdc, v ih = v dd ?.2 vdc stop i dd measured with osc1 = v ss 4. run and wait i dd limit values are with no load on pd5 clockout, when pd5 is enabled. run and wait i dd values are for both pd5 enabled and disabled and lvr enabled and disabled. characteristic (1) symbol min max unit rise time fall time pulse width c load pullup 0.5 s 13 ns 2.4 s 59 pf 10 k 1.0 s 20 ns 2.7 s 100 pf 10 k 2.5 s 42 ns 3.7 s 250 pf 10 k note: v dd = 4.5 vdc, v ss = 0 vdc, t a = 125 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required electrical speci?ations technical data mc68HC05P18A 120 electrical specifications motorola 13.8 a/d converter characteristics characteristic (1) 1. v dd = 5.0 10% vdc 10%, v ss = 0 vdc, t a = ? 40 c to +125 c, unless otherwise noted min max unit comments resolution 8 8 bits absolute accuracy v dd v refh > 4.5 +1 1/2 lsb including quantization conversion range v refh v ss v ss v refh v dd v a/d accuracy may decrease proportionately as v refh is reduced below 4.5 v. input leakage ad0, ad1, ad2, ad3 v refh +1 +1 a conversion time (2) (includes sampling time) 2. t ad = t cyc if clock source equals mcu 32 32 t ad (note 2) monotonicity inherent (within total error) zero input reading external internal 00 00 01 03 hex v in = 0 v full-scale reading fe ff hex v in = v refh sample time 12 12 t ad (note 3) input capacitance 12 pf analog input voltage v ss v refh v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications siop timing mc68HC05P18A technical data motorola electrical specifications 121 non-disclosure agreement required 13.9 siop timing figure 13-1. siop timing diagram sdi bit 1 ... 6 bit 7 bit 0 sdo bit 0 bit 1 ... 6 bit 7 sck t 6 t 1 t 5 t 3 t 4 t 2 no. characteristic (1) symbol min max unit operating frequency (2) master slave f op( m ) f op( s ) 1 dc 1 1 f op 1 cycle time master slave t cyc(m) t cyc(s) 4.0 4.0 4.0 t cyc 2 sck low time t cyc 238 ns 3 sdo data valid time t v 200 ns 4 sdo hold time t ho 0ns 5 sdi setup time t s 100 ns 6 sdi hold time t h 100 ns 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 c to +125 c, unless otherwise noted 2. f op = f osc 2; t cyc = 1 f op f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required electrical speci?ations technical data mc68HC05P18A 122 electrical specifications motorola 13.10 pd5 clock out timing (pd5 clock out option enabled) figure 13-2. pd5 clock out timing note: all timing is shown with respect to 20% and 70% v dd . maximum rise and fall times assume 44% duty cycle. minimum rise and fall times assume 55% duty cycle. characteristic symbol min max unit cycle time 1 t cyc ns rise time 4 3.5 12 ns fall time 5 7.5 27.5 ns pulse width 2, 3 t oh , t ol ?s d5 clk out (4) (5) (2) (1) (3) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
electrical specifications control timing mc68HC05P18A technical data motorola electrical specifications 123 non-disclosure agreement required 13.11 control timing characteristic (1) 1. v dd = 5.0 vdc, v ss = 0 vdc, t a = ?0 c to +125 c, unless otherwise noted symbol min max unit frequency of operation crystal option external clock source f osc dc 4.2 4.2 mhz internal operating frequency crystal (f osc 2) external clock (f osc 2) f op dc 2.1 2.1 mhz cycle time low speed high speed t cyc 476 238 ?s crystal oscillator startup time t oxon 100 ms stop recovery startup time (crystal oscillator) t ilch 100 ms reset pulse width t rl 1.5 t cyc interrupt pulse width low (edge-triggered) t ilih 125 ns interrupt pulse period (2) 2. the minimum period, t ilil , should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . t ilil note 2 t cyc osc1 pulse width low speed high speed t oh , t ol 200 100 ?s a/d on current stabilization time t adon 100 s rc oscillator stabilization time t rcon 5.0 s f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required technical data mc68HC05P18A 124 electrical specifications motorola electrical speci?ations figure 13-3. power-on reset and external reset timing diagram pch pcl osc1 (2) reset internal processor internal address bus (1) 3ffe 3fff v dd v dd threshold (1-2 v typical) t vddr 4064 t cyc t cyc t rl internal data bus (1) 3ffe 3ffe 3ffe 3ffe new pc 3fff notes: 1. internal timing signal and bus information are not available externally. 2. osc1 line is not meant to represent frequency. it is used only to represent time. 3. the next rising edge of the ph2 clock following the rising edge of reset initiates the reset sequence. note 3 new new op code pcl pch new pc new pc op code new pc clock (1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola mechanical specifications 125 non-disclosure agreement required technical data ?mc68HC05P18A section 14. mechanical specifications 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 14.3 28-pin plastic dual in-line package (case #710) . . . . . . . . .126 14.4 28-pin small outline package (case #751f) . . . . . . . . . . . . .126 14.2 introduction this section provides package dimension drawings for the 28-pin plastic dual in-line (pdip) or 28-pin small outline (soic) packages. to make sure that you have the latest case outline specifications, contact: local motorola sales office motorola mfax phone 602-244-6609 email rmfax0@email.sps.mot.com worldwide web (wwweb) at http://design-net.com follow mfax or wwweb on-line instructions to retrieve the current mechanical specifications. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required mechanical speci?ations technical data mc68HC05P18A 126 mechanical specifications motorola 14.3 28-pin plastic dual in-line package (case #710) 14.4 28-pin small outline package (case #751f)     
  
     
 
 
   
           
         
  

  

      
          
                       !"!#! !     $      !       !   !    # !  114 15 28 b a c n k m j d
  f hg l     
 
           
   
         
             
         
     
         !$  $   %
 !    $ ! !!  !      # ! #
 !"!#! ! #      !    # ! #  ! #        "   !  !"!#! !  -a- -b- 114 15 28 -t- c
      ! ! m j -t- k 26x g 28x d 14x p r x 45       !   f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A technical data motorola ordering information 127 non-disclosure agreement required technical data mc68HC05P18A section 15. ordering information 15.1 contents 15.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 15.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 15.2 introduction this section contains instructions for ordering the mc68HC05P18A. 15.3 mc order numbers table 15-1 shows the mc order numbers for the available package types. table 15-1. mc order numbers mc order number (1) 1. p = plastic dual in-line package dw = small outline (wide body) package operating temperature range mc68HC05P18Ap (standard) 0 40 40 40 40 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-disclosure agreement required ordering information technical data mc68HC05P18A 128 ordering information motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
mc68HC05P18A/d ? motorola, inc., 1999 motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee r egarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and speci cally disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or speci cations can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer applica tion by customer's technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failu re of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized applicati on, buyer shall indemnify and hold motorola and its of cers, employees, subsidiaries, af liates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that mot orola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportuni ty/af rmative action employer. how to reach us: usa/europe/locations not listed: motorola literature distribution, p.o. box 5405, denver, colorado 80217. 1-303-675-2140 or 1-800-441-2447. customer focus center, 1-800-521-6274 japan: motorola japan ltd.; sps, technical information center, 3-20-1, minami-azabu, minato-ku, tokyo 106-8573 japan. 81-3-3440-8573 asia/pacific: motorola semiconductors h.k. ltd.; silicon harbour centre, 2 dai king street, tai po industrial estate, tai po, n.t., hong kong. 852-26668334 mfax , motorola fax back system: rmfax0@email.sps.mot.com; http://sps.motorola.com/mfax/; touchtone, 1-602-244-6609; us and canada only, 1-800-774-1848 home page: http://motorola.com/sps/ mfax is a trademark of motorola, inc. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of 68HC05P18A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X